Roundup Tracker - Issues


Author rouilj
Recipients ber, joseph_myers, rouilj, schlatterbeck, tttech-klonner
Date 2021-04-08.18:35:01
Message-id <>
In-reply-to <>
Hi Ralf and Joseph:

In message <>,
Joseph Myers writes:
>Since the provided in all the templates shipped with 
>Roundup uses ValueError like this (for incorrect data provided by a 
>tracker user rather than a bug in the tracker), I expect that example is 
>very widely followed by people's own detectors.

My detectors also use ValueError(21 times) for cases where the user
supplied value is incorrect. E.G.

   raise ValueError('Timezone "%s" does not exist' % tz)

From the exception message, it looks like it is intended for the user.
I use this when the user supplied an invalid value.

They also use:

   roundupdb.DetectorError, mailgw.Unauthorized and MessageSendError

which are intended for the administrator.

Along with:

   Reject, RejectRaw

meant for the users. These are used when the values are valid but
something else (e.g. trying to close an issue with open dependencies,
setting up a loop of issues etc.)

The template detectors use:

  ValueError (lots)

So I claim we should keep ValueError at least. I am not sure about the
KeyError or IndexError. From a user level perspective, I would expect
KeyError to be mapped to a ValueError assuming the user supplied the
key value. IndexError, I am not sure why that is being reformatted.

I don't remeber having any issues with a rogue ValueError or
IndexError causing issue or had issues debugging the cause of the

That said, I assume this is the issue Ralf was trying to debug.  I can
see a couple of ways of making this easier.  Adding an option to

   detector_debug = Yes/No
   detector_debug = InvalidOptionError, DetectorError, ValueError

(maybe auditor_debug would be better) which would:

   enable tracebacks for all detector/auditor exceptions except
   enable tracebacks for only specified exceptions

If we can determine where the exception is thrown another possibility
presents itself. If it's not raised in a detector file you get a

So if in detectors/ I have:

    raise ValueError('this is an allowed error')

or if I have:
    except ValueError:

      check some stuff

they get formatted like Reject.

However if in detectors/ I call:


and that raises a ValueError I get a traceback.

The ideas is if the user raised/re-raised the exception by writing
code in a detector, format it like Reject. If the exception originates
from code called by the detector and not caught you get the traceback
to help debug the issue.


Have a great weekend all.
Date User Action Args
2021-04-08 18:35:01rouiljsetrecipients: + rouilj, schlatterbeck, ber, joseph_myers, tttech-klonner
2021-04-08 18:35:01rouiljlinkissue2551127 messages
2021-04-08 18:35:01rouiljcreate