Part of lp.bugs.scripts.checkwatches
Function | report_oops | Record an oops for the current exception. |
Function | report_warning | Create and report a warning as an OOPS. |
Class | WorkingBase | A base class for writing a long-running process. |
Function | with_interaction | Wrap a method to ensure that it runs within an interaction. |
Function | commit_before | Wrap a method to commit any in-progress transactions. |
This must only be called while handling an exception.
Searches for 'URL', 'url', or 'baseurl' properties, in order of preference, to use as the linked URL of the OOPS report.
Parameters | message | custom explanatory error message. Do not use str(exception) to fill in this parameter, it should only be set when a human readable error has been explicitly generated. |
properties | Properties to record in the OOPS report. (type: An iterable of (name, value) tuples.) | |
info | Exception info. (type: The return value of sys.exc_info() .) | |
transaction_manager | A transaction manager. If specified, further commit() calls will be logged. |
If no exception info is passed in this will create a generic
BugWatchUpdateWarning
to record.
Parameters | message | See report_oops . |
properties | See report_oops . | |
info | See report_oops . | |
transaction_manager | See report_oops . |
If an interaction is already set up, this simply calls the function. If no interaction exists, it will set one up, call the function, then end the interaction.
This is intended to make sure the right thing happens whether or not the function is run in a different thread.
It's intended for use with WorkingBase
, which provides an
interaction
property; this is the hook that's required.
This is chiefly intended for use with public-facing methods, so that callers do not need to be responsible for committing before calling them.
It's intended for use with WorkingBase
, which provides a
_transaction_manager
property; this is the hook that's required.