@@ -0,0 +1,1710 @@
+#----------------------------------------------------------------------%0A# Copyright (c) 2012-2015 Raytheon BBN Technologies%0A#%0A# Permission is hereby granted, free of charge, to any person obtaining%0A# a copy of this software and/or hardware specification (the %22Work%22) to%0A# deal in the Work without restriction, including without limitation the%0A# rights to use, copy, modify, merge, publish, distribute, sublicense,%0A# and/or sell copies of the Work, and to permit persons to whom the Work%0A# is furnished to do so, subject to the following conditions:%0A#%0A# The above copyright notice and this permission notice shall be%0A# included in all copies or substantial portions of the Work.%0A#%0A# THE WORK IS PROVIDED %22AS IS%22, WITHOUT WARRANTY OF ANY KIND, EXPRESS%0A# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF%0A# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND%0A# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT%0A# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,%0A# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,%0A# OUT OF OR IN CONNECTION WITH THE WORK OR THE USE OR OTHER DEALINGS%0A# IN THE WORK.%0A#----------------------------------------------------------------------%0A%22%22%22%0AWhen AggregateManager delegate's raise that type of exception, the result of%0Athe current call will be a well formatted result, with a message as in %0A%7B 'output': 'exception output', %0A  'code': %7B'am_type': 'gcf', %0A           'geni_code': %3Cexception code%3E%7D, %0A  'value': ''%7D%0A%22%22%22%0A%0Aclass ApiErrorException(Exception):%0A    def __init__(self, code, output):%0A        self.code = code%0A        self.output = output%0A%0A    def __str__(self):%0A        return %22ApiError(%25r, %25r)%22 %25 (self.code, self.output)%0A

Rework the patch to handle ApiErrorException in a generic way in AMMethodContext. Create a specific file for ApiErrorException so as to be able to import it from am3.py and am_method_context.py.