1 # Licensed to the Apache Software Foundation (ASF) under one or more
2 # contributor license agreements. See the NOTICE file distributed with
3 # this work for additional information regarding copyright ownership.
4 # The ASF licenses this file to You under the Apache License, Version 2.0
5 # (the "License"); you may not use this file except in compliance with
6 # the License. You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
22 from .. import exceptions
25 class ExecutorException(exceptions.AriaError):
27 General executor exception.
32 class ProcessException(ExecutorException):
34 Raised when subprocess execution fails.
37 def __init__(self, command, stderr=None, stdout=None, return_code=None):
39 Process class Exception
40 :param list command: child process command
41 :param str message: custom message
42 :param str stderr: child process stderr
43 :param str stdout: child process stdout
44 :param int return_code: child process exit code
46 super(ProcessException, self).__init__("child process failed")
47 self.command = command
50 self.return_code = return_code
53 def explanation(self):
55 Describes the error in detail
58 'Command "{error.command}" executed with an error.{0}'
59 'code: {error.return_code}{0}'
60 'error: {error.stderr}{0}'
61 'output: {error.stdout}'.format(os.linesep, error=self))
64 class AriaEngineError(exceptions.AriaError):
66 Raised by the workflow engine.
70 class TaskException(exceptions.AriaError):
76 class TaskCreationException(TaskException):
78 Could not create the task.
82 class OperationNotFoundException(TaskCreationException):
84 Could not find an operation on the node or relationship.
88 class PluginNotFoundException(TaskCreationException):
90 Could not find a plugin matching the plugin specification.