# Path: simpleapi/message/common.py
# class SAException(Exception):
#     def __init__(self, msg=None):
#     def _get_message(self):
#     def _set_message(self, message):
#     def __repr__(self):


from simpleapi.message.common import json
            if errors:
                r['result'].update(ExtJSWrapper.build_errors(errors))
                r['result']['success'] = False
            else:
                r['result']['success'] = True
                r['result']['data'] = result
            
            return r
        else:
            if errors:
                errors = ExtJSWrapper.build_errors(errors)
                return {
                    'type': 'exception',
                    'message': errors['msg'],
                    'where': 'n/a'
                }
            else:
                return {
                    'result': result,
                    'type': db['type'],
                    'tid': db['tid'],
                    'action': db['action'],
                    'method': db['method'],
                }

    def parse(self, items):
        if len(items) == 1:
            # check for a batch request
            key, value = items.items()[0]
            if value == '':

# Path: simpleapi/message/common.py
# class SAException(Exception):
#     def __init__(self, msg=None):
#     def _get_message(self):
#     def _set_message(self, message):
#     def __repr__(self):


# Path: simpleapi/message/wrapper.py
from simpleapi.message.common import json

            if errors:
                r['result'].update(ExtJSWrapper.build_errors(errors))
                r['result']['success'] = False
            else:
                r['result']['success'] = True
                r['result']['data'] = result
            
            return r
        else:
            if errors:
                errors = ExtJSWrapper.build_errors(errors)
                return {
                    'type': 'exception',
                    'message': errors['msg'],
                    'where': 'n/a'
                }
            else:
                return {
                    'result': result,
                    'type': db['type'],
                    'tid': db['tid'],
                    'action': db['action'],
                    'method': db['method'],
                }

    def parse(self, items):
        if len(items) == 1:
            # check for a batch request
            key, value = items.items()[0]
            if value == '':

                data = json.loads(key)