#NEWLINE# def default( default ) : #NEWLINE# #INDENT# '\n    API class method wrapper to specify the default value.\n\n    Default will usually be returned if an exception is raised, like from a \n    JSON parsing attempt on a bad request.\n    ' #NEWLINE# def decorator( fn ) : #NEWLINE# #INDENT# def wrapped_func( self , * args , **kwargs ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# return fn ( self , * args , ** kwargs ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# return { #NEWLINE# #INDENT# 'success' : False , #NEWLINE# 'result' : default , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# #UNINDENT# return wrapped_func #NEWLINE# #UNINDENT# return decorator