summaryrefslogtreecommitdiff
path: root/taskflow/exceptions.py
Commit message (Collapse)AuthorAgeFilesLines
* Remove sixTakashi Kajinami2022-05-181-9/+8
| | | | | | | | This library no longer supports Python 2, thus usage of six can be removed. This also removes workaround about pickle library used in Python 2 only. Change-Id: I19d298cf0f402d65f0b142dea0bf35cf992332a9
* Remove the duplicated wordmelissaml2018-08-211-1/+1
| | | | Change-Id: Ia9964fd613efc49479e763b6a7095d63115179ab
* Split revert/execute missing args messagesGreg Hill2016-05-261-1/+5
| | | | | | | | | To make it more obvious when a revert method is missing a dependency, we now identify which method was missing the required paramater. Change-Id: I24b0d0b01dbd239b92ba444f6ef44273c5ac25d3 Closes-Bug: 1581616
* Allow for alterations in decider 'area of influence'Joshua Harlow2016-01-091-0/+8
| | | | | | | | Christmas came early. Closes-Bug: #1479466 Change-Id: I931d826690c925f022dbfffe9afb7bf41345b1d0
* Use encodeutils for exception -> string functionJoshua Harlow2015-06-301-17/+16
| | | | | | | | | | | The oslo.utils library now provides a better version of this that always returns a unicode exception message, so update our usage to use it (and remove our own local function). This guarantee of unicode also means we have to update a few other places to make sure we get back bytes or unicode as needed. Change-Id: I924380408aaf6d2aec418ceaaf623c75900268f7
* Use the `excutils.raise_with_cause` after doing our type checkJoshua Harlow2015-06-161-7/+2
| | | | Change-Id: Ica886e67b4a75cb695d3ed51a3a952ca8f60f300
* Validate correct exception subclass in 'raise_with_cause'Joshua Harlow2015-04-181-0/+2
| | | | Change-Id: Ia1a8b692eda2f3856bb4e23a9baa34ac06096d3a
* Ensure we don't get stuck in formatting loopsJoshua Harlow2015-04-081-1/+3
| | | | Change-Id: I516dc2aca05823add9daf8c6d4c4af7ef7d2a313
* Avoid going into causes of non-taskflow exceptionsJoshua Harlow2015-04-031-4/+6
| | | | Change-Id: If043bf27f3b025a279f3747841e9a88fcc5fab85
* Make an attempt at having taskflow exceptions print causes betterJoshua Harlow2015-03-311-27/+44
| | | | | | | | | | It is often quite useful to try to see what the contained causes are on versions of python that do not have the native support for this built-in so to make everyones life easier add basic support for traversing the cause list and printing out associated causes when we are able to. Change-Id: Ia0a7e13757a989722291bcc06599d04014706d8c
* Chain exceptions correctly on py3.xJoshua Harlow2015-02-201-2/+35
| | | | | | | | | | | | In order to chain exceptions add a helper that can be used to chain exceptions automatically (when able) and use it in the various places we are already creating a new exception with a prior cause so that on py3.x the newly created exception has its 'cause' associated using the syntax available to do chaining in py3.x (which formats nicely as well in that python version). Change-Id: Iffddb27dbfe80816d6032e4b5532a0011ceedc95
* Fix log statementManish Godara2015-02-131-1/+1
| | | | | | | | Added quotes around flow repr output used in exception. Since the name can contain spaces it maybe sometimes confusing to debug without the quotes. Change-Id: I469af4758acb41c0d79f2368d21b707e88639047
* Use platform neutral line separator(s)Joshua Harlow2015-01-121-2/+8
| | | | | | | | To at least try to support things like windows it's better if we can make an attempt to use the platform neutral characters for line separator(s) where appropriate. Change-Id: Icc533ed4d4c94f461b7f19600b74146221f17b18
* Properly handle and skip empty intermediary flowsJoshua Harlow2014-12-101-0/+4
| | | | | | | | | | | | Instead of linking nodes which have elements to predecessors which do not we should search backwards through the prior predecessors and link to one that does have nodes; this ensures that we do not create bad workflows when empty flows are injected. Fixes bug 1392650 Change-Id: Ic362ef3400f9c77e60ed07b0097e3427b999d1cd
* Move the _pformat() method to be a classmethodJoshua Harlow2014-12-021-15/+20
| | | | | | | | | | | | | | To avoid creating nested functions when a class one will suffice just switch to using a class method for the nested _pformat() function instead. This also makes sure that the cause of a exception is not none before attempting to format it (and its children) and also passes along a lines list that is appended/extended instead of each function call creating its own version which is later merged. Change-Id: Ie84b004c115e488c87f9829bfcf4d8f66ebb660f
* Remove direct usage of the deprecated failure locationJoshua Harlow2014-10-211-2/+2
| | | | | | | | Internally we should be using the new location and not the deprecated location wherever possible. This avoids emitting warnings messages on our own code, which is a dirty habit. Change-Id: Idac5a772eca7529d92542ada3be1cea092880e25
* Merge "Document more function/class/method params"Jenkins2014-10-181-7/+32
|\
| * Document more function/class/method paramsJoshua Harlow2014-09-261-7/+32
| | | | | | | | | | | | | | | | | | | | To help fill out the docs start adding on docstrings that document what a parameter is and what its meaning and usage is to help users better understand the parameter. Part of ongoing bug 1374202 Change-Id: I9f9a83cfb763a0a05d22efca4e0f80627ba8ca8f
* | Merge "Relax the graph flow symbol constraints"Jenkins2014-10-181-0/+4
|\ \
| * | Relax the graph flow symbol constraintsJoshua Harlow2014-09-081-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to make it possible to have a symbol tree we need to relax the constraints that are being imposed by the graph flow. Part of blueprint taskflow-improved-scoping Change-Id: I2e14de2131c3ba4e3e4eb3108477583d0f02dae2
* | | Switch to a custom NotImplementedError derivativeJoshua Harlow2014-10-081-0/+9
| |/ |/| | | | | | | | | | | | | | | | | When a feature or method is not implemented it's useful to throw our own derivative of a NotImplementedError error so that we can distingush these types of errors vs actual usage of NotImplementedError which could be thrown from driver or user code. Change-Id: I8d5dfb56a254f315c5509dc600a078cfef2dde0b
* | Merge "Expand documention on failures and wrapped failures types"Jenkins2014-09-201-5/+10
|\ \ | |/ |/|
| * Expand documention on failures and wrapped failures typesJoshua Harlow2014-08-191-5/+10
| | | | | | | | | | | | | | | | | | To make it more clear why these objects and types exist and when and why they are used and reraised increase the verbosity of the comments and associated inline documentation on these two classes to help explain there existence & usefulness. Change-Id: I742bbcd69c71df80e6de7becc8aee153bf16b34b
* | Allow handlers to provide validation callablesJoshua Harlow2014-07-251-0/+4
|/ | | | | | | | | | | In order to reject messages before they are processed make it possible to provide a handler pair that will validate the incoming message and either reject or allow the message to be passed to the provided handler. Part of blueprint wbe-message-validation Change-Id: Ibd6ee40020c6b98283f40d5bd59e8950d63b7f71
* Upgrade hacking version and fix some of the issuesJoshua Harlow2014-06-131-3/+1
| | | | | | | | | | | | | | | | | Update hacking to the new requirements version and fix about half of the new reported issues. The other hacking issues are for now ignored until fixed by adjusting our tox.ini file. This commit fixes the following new hacking errors: H405 - multi line docstring summary not separated with an empty line E265 - block comment should start with '# ' F402 - import 'endpoint' from line 21 shadowed by loop variable Change-Id: I6bae61591fb988cc17fa79e21cb5f1508d22781c
* Allow for two ways to find a flow detail in a job for a conductorJoshua Harlow2014-05-301-0/+4
| | | | | | | | | | | | | | | | | Previously we had the code looking at the first logbook entry and running with that. That doesn't work so well especially since the logbook may be unordered. So we then switched to require a job to provide a 'flow_uuid' key to determine which one to run. This makes sense and avoids the problem of being unable to determine which one to run but makes it harder to use for those that have just logbooks with single entries (likely the common case). So add in a slightly more advanced finding logic that will check for existence of 'flow_uuid' and if found use it, otherwise if not found then check if the logbook is only a single item and if so use that instead (and otherwise abort). Change-Id: Id1e11e8b4e48af3389e5c4e0818777ff9abf9463
* Merge "Allow indent text to be passed in"Jenkins2014-05-301-2/+2
|\
| * Allow indent text to be passed inJoshua Harlow2014-05-291-2/+2
| | | | | | | | | | | | | | | | | | Instead of forcing single space indenting allow the indenting string to be passed in so that others can provided their favorite indent (tabs, two spaces or other...) Change-Id: I2dfb3baeaecb8bed197429b591daed69eb8cc834
* | Adds a single threaded flow conductorDan Krause2014-05-281-0/+6
|/ | | | | | | | | | | | | | Creates a new conductor module that can be used to connect into the jobboard, engine, and persistence mechanism. This commit adds in support for a simple conductor that will run jobs in its own thread and will dispatch them, and consume/abandon them. Implements: blueprint generic-flow-conductor Change-Id: Ic610bc825506db57b0c4364b0fc588b51d453a76
* Stings -> StringsJoshua Harlow2014-04-191-1/+1
| | | | | | Fix spelling mistake. Change-Id: Iadbd3663a8f1cc8e95a754a165ef682490736256
* Use correct exception in the timing listenerStanislav Kudriashev2014-04-011-1/+1
| | | | | | | Used `StorageFailure` exception instead of non-existing `StorageError` in the timing listener. Change-Id: I83035b737f7507b760799a5d44d4c7d097103ae5
* Should be greater or equal to zero and not greater thanJoshua Harlow2014-03-261-1/+1
| | | | Change-Id: I7897f847598133cbc1ed425847f2a708e4f6d195
* Adjust the exception hierachyJoshua Harlow2014-03-241-62/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Group the exceptions into the following groups * Storage * Jobs * Execution * Other (wrapped failure here) This grouping makes it easier to understand where one type of exception should be used vs using another type of exception. Backwards incompatible changes: * StorageError -> StorageFailure * AlreadyExists -> Duplicate * WrappedFailure now inherits from Exception and not directly from TaskFlowException since it wraps arbitrary other exceptions and is not specific to taskflow. Cleanups: * JobNotFound -> NotFound * EmptyFlow -> Empty * JobAlreadyExists -> AlreadyExists * InvariantViolation (X) * ConnectionFailure (X) Change-Id: I0e1e81b513fbbc7adb8bfaa1244993e345ab70d3
* Merge "Add zookeeper job/jobboard impl"Jenkins2014-02-261-2/+12
|\
| * Add zookeeper job/jobboard implJoshua Harlow2014-02-241-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create a base implementation of a jobboard which serves as a place to post work to be done, a place to get notified of new work, and a place which can be used to atomically acquire that work (so that it can be worked on) as well as transfer that work from one entity (say when that entity fails) to another entity (for further resumption or other policy/code driven recovery processes). Implements: blueprint job-reference-impl Change-Id: I1de1525df0deee612fb14ca36f0415ea7d2f707c
* | Unify usage of storage error exception typeJoshua Harlow2014-02-241-0/+2
|/ | | | | | | | | | | | - Instead of formatting the exception by creating a storage error instance we can just let the already included cause make this formatting occur. - Handle cases in impl_dir which were not catching and raising storage errors. - Unify usage of 'backend internal error' messaging. - Pass the cause to storage errors where applicable. Change-Id: Ieb14256b202ccbfa3a96f68fa35db7e40f92114d
* Merge "Move some common/to be shared kazoo utils to kazoo_utils"Jenkins2014-02-211-0/+5
|\
| * Move some common/to be shared kazoo utils to kazoo_utilsJoshua Harlow2014-02-201-0/+5
| | | | | | | | | | | | | | | | | | | | Stopping and closing in a way that will avoid the current kazoo bug will be a common utility function so move it to kazoo_utils. The other common utility function will be version checking so move that as well to kazoo_utils (and improve it to allow for checking against a max version). Change-Id: I81dfd9c01a00d7491b973d65d3b38f61b29dd298
* | Merge "Message-oriented worker-based flow with kombu"Jenkins2014-02-201-0/+4
|\ \
| * | Message-oriented worker-based flow with kombuStanislav Kudriashev2014-02-191-0/+4
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implemented Worker to be started on remote host for handling tasks request. * Implemented WorkerTaskExecutor that proxies tasks requests to remote workers. * Implemented Proxy that is used for consuming and publishing messages by Worker and Executor. * Added worker-based engine and worker task executor. * Added kombu dependency to requirements. * Added worker-based flow example. * Added unit-tests for worker-based flow components. Implements: blueprint worker-based-engine Change-Id: I8c6859ba4a1a56c2592e3d67cdfb8968b13ee99c
* | Remove extraneous vim configuration commentsyangxurong2014-02-141-2/+0
|/ | | | | | | | | Remove line containing comment - # vim: tabstop=4 shiftwidth=4 softtabstop=4 Change-Id: I7581cc88b8de433d5609ed06c6570b0b45c13573 Closes-Bug:#1229324
* Be really careful with non-ascii data in exceptions/failuresIvan A. Melnikov2014-02-041-1/+15
| | | | | | | | | | When exception message is Python 2 str with non-ascii symbols, six.text_type(exc) raises UnicodeError. This change handles this case gracefully by calling str() instead of string.text_type() on such exceptions when retrieving messages for exceptions/failures. Closes-bug: 1276053 Change-Id: I2eb7318a7a5cd5dd687390a65abc0a45bd47de40
* Implement ZooKeeper as persistence storage backendChangbin Liu2014-01-281-0/+5
| | | | | | | | | | | | | | | | | Test cases are in taskflow/tests/unit/persistence/test_zk_persistence and taskflow/tests/unit/persistence/test_zake_persistence. The former requires a working ZooKeeper cluster, and the latter uses a fake in-memory backend. Right now, due to the lack of ZooKeeper in Jenkins, the former test is disabled. To enable it, simply uncomment the code and change "hosts" in conf to your ZooKeeper cluster's addresses. Also moved some shared helper functions from taskflow/persistence/backends/impl_dir to taskflow/utils/persistence_utils. Implements: blueprint zk-logbook Change-Id: Ia1b7ef8312a1761515515fd206b36be135119737
* Doc strings and comments clean-upskudriashev2014-01-261-4/+4
| | | | | | | | * Added missing period for doc strings * Correct syntax errors * Remove H402 from flake8 ignore list Change-Id: Ia8592bf99378e3658d6cca2ceb148bf9eb0b5de8
* Exceptions cleanupIvan A. Melnikov2014-01-141-9/+4
| | | | | | | | | | | | | | | | | Most TaskFlow exception don't have 'Exception' suffix in their names, so we drop it from the few that have it, for sake of consistency and more concise and expressive code. MissingDependencies parent object is changed from InvalidState to InvariantViolation, which is more appropriate. Unused ClosedException is dropped. Breaking change: any client code that used renamed exceptions, ClosedException or relied on catching MissingDependencies as InvariantViolationException is affected. Change-Id: I649b7760d382ccb6df333bdffd667ba6b67a431e
* Fix misspellingsStanislav Kudriashev2013-12-101-1/+1
| | | | Change-Id: I6f332f01d197c6ba1b02de1145714718f8aea6fb
* Raise exception when trying to run empty flowAnastasia Karpinska2013-12-101-0/+5
| | | | Change-Id: If5d379ed81e926bfc53dbc17f7b1cb912b3c226b
* Validate each flow state changeIvan A. Melnikov2013-10-071-1/+1
| | | | | | | | | When engine changing state, the transition is now validated. This helps to avoid complex and error prone checks in engine._change_state and make validating code more reusable in different engines. Change-Id: I2a06823c532926bb3bd034f7252b14bdbbc1fa1d Implements: bp:transition-control
* Some small exception cleanupsJoshua Harlow2013-10-051-3/+5
| | | | | | | | | | Whitespace change and compare directly to none since user exceptions may have overloaded the boolean operator and avoid checking the exception classes if the input is empty in the first place. Change-Id: I426741bbc23181e96084383eaf77daa1d612ab59
* Wrapping and serializing failuresIvan A. Melnikov2013-10-041-31/+44
| | | | | | | | | | | | * save task failures to sqlalchemy backend and restore them from there; * for any wrapped exception use common WrappedFailre exception type, which makes it easier to handle particular exception types; * several minor improvements. Affects-db: this change adds db migration that looses exception information for saved task details. Change-Id: I575282002e6999646bbf51f492b82a7e3525787a