Common.py
def error_code_handler(json_input_object):
    """I pass everything as a response now, so I technically produce only valid responses.
       This will work later down the way so when the response is compiled, it's a formatted error message."""
    json_input = json.loads(json_input_object.text)
    if 'statusCode' in json_input.keys():
        if not json_input['statusCode'] == '200':
            json_input['copyright'] = 'Malformed Request'
            json_input['reference'] = "***\nif you are seeing this, You have made a malformed request. \n\n " \
                                      "Please ensure that you have picked a book and version that is accessible, " \
                                      "as well as formed the request correctly. \n\n , simply mention this bot\'s " \
                                      "username, and state look up somewhere in your comment. \n\n Then you can " \
                                      "specify as many verse selections under the 8000 character limit\n\n like " \
                                      "this: [John 3:16 KJV]"
            json_input['content'] = str.join('', (json_input['error'], ':', '\n\n',   json_input['message']))
            fake_data_holder = dict()
            fake_data_holder['data'] = json_input
            return json_input
    else:
        return json_input['data']
I pass everything as a response now, so I technically produce only valid responses.
       This will work later down the way so when the response is compiled, it's a formatted error message.
I pass everything as a response now, so I technically produce only valid responses.
This will work later down the way so when the response is compiled, it's a formatted error message.
I pass everything as a response now so I technically produce only valid responses . This will work later down the way so when the response is compiled it ' s a formatted error message .
def error_code_handler(json_input_object):
    json_input = json.loads(json_input_object.text)
    if 'statusCode' in json_input.keys():
        if not json_input['statusCode'] == '200':
            json_input['copyright'] = 'Malformed Request'
            json_input['reference'] = "***\nif you are seeing this, You have made a malformed request. \n\n " \
                                      "Please ensure that you have picked a book and version that is accessible, " \
                                      "as well as formed the request correctly. \n\n , simply mention this bot\'s " \
                                      "username, and state look up somewhere in your comment. \n\n Then you can " \
                                      "specify as many verse selections under the 8000 character limit\n\n like " \
                                      "this: [John 3:16 KJV]"
            json_input['content'] = str.join('', (json_input['error'], ':', '\n\n',   json_input['message']))
            fake_data_holder = dict()
            fake_data_holder['data'] = json_input
            return json_input
    else:
        return json_input['data']
def error_code_handler ( json_input_object ) : json_input = json . loads ( json_input_object . text ) if 'statusCode' in json_input . keys ( ) : if not json_input [ 'statusCode' ] == '200' : json_input [ 'copyright' ] = 'Malformed Request' json_input [ 'reference' ] = "***\nif you are seeing this, You have made a malformed request. \n\n " "Please ensure that you have picked a book and version that is accessible, " "as well as formed the request correctly. \n\n , simply mention this bot\'s " "username, and state look up somewhere in your comment. \n\n Then you can " "specify as many verse selections under the 8000 character limit\n\n like " "this: [John 3:16 KJV]" json_input [ 'content' ] = str . join ( '' , ( json_input [ 'error' ] , ':' , '\n\n' , json_input [ 'message' ] ) ) fake_data_holder = dict ( ) fake_data_holder [ 'data' ] = json_input return json_input else : return json_input [ 'data' ]
I pass everything as a response now, so I technically produce only valid responses.
I pass everything as a response now so I technically produce only valid responses .
"""I pass everything as a response now, so I technically produce only valid responses.
       This will work later down the way so when the response is compiled, it's a formatted error message."""
json_input_object