'Raises an exception (debugging).'

@web.json
def generate_json_error(self, trans, code=500):

    try:
        code = int(code)
    except Exception:
        code = 500
    if (code == 502):
        raise HTTPBadGateway()
    trans.response.status = code
    return {'error': 'Fake    error!'}
