#NEWLINE# @ cp . expose #NEWLINE# def default( self , * path , **data ) : #NEWLINE# #INDENT# ' Resolves URL paths to handler functions and casts the return value.\n        ' #NEWLINE# for ( k , v ) in g . items ( ) : #NEWLINE# #INDENT# data [ k ] = v #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# v = self . router ( path , ** data ) #NEWLINE# #UNINDENT# except RouteError : #NEWLINE# #INDENT# raise cp . HTTPError ( '404 Not Found' ) #NEWLINE# #UNINDENT# except RateLimitForbidden : #NEWLINE# #INDENT# raise cp . HTTPError ( '403 Forbidden' ) #NEWLINE# #UNINDENT# except RateLimitExceeded : #NEWLINE# #INDENT# raise cp . HTTPError ( '429 Too Many Requests' ) #NEWLINE# #UNINDENT# except DatabaseError as e : #NEWLINE# #INDENT# raise cp . HTTPError ( '503 Service Unavailable' , message = str ( e ) ) #NEWLINE# #UNINDENT# except HTTPRedirect as e : #NEWLINE# #INDENT# raise cp . HTTPRedirect ( e . url ) #NEWLINE# #UNINDENT# except HTTPError as e : #NEWLINE# #INDENT# raise cp . HTTPError ( e . status , message = e . message ) #NEWLINE# #UNINDENT# v = self . _cast ( v ) #NEWLINE# return v