Using a constant for server error instead of 500

This commit is contained in:
Strahinja Val Markovic 2013-09-27 16:24:42 -07:00
parent 446d02f66e
commit 1027de73fb

View File

@ -39,6 +39,7 @@ import server_state
from ycm import user_options_store from ycm import user_options_store
from ycm.server.responses import BuildExceptionResponse from ycm.server.responses import BuildExceptionResponse
import argparse import argparse
import httplib
# num bytes for the request body buffer; request.json only works if the request # num bytes for the request body buffer; request.json only works if the request
# size is less than this # size is less than this
@ -128,7 +129,7 @@ def DefinedSubcommands():
# The type of the param is Bottle.HTTPError # The type of the param is Bottle.HTTPError
@app.error( 500 ) @app.error( httplib.INTERNAL_SERVER_ERROR )
def ErrorHandler( httperror ): def ErrorHandler( httperror ):
return _JsonResponse( BuildExceptionResponse( str( httperror.exception ), return _JsonResponse( BuildExceptionResponse( str( httperror.exception ),
httperror.traceback ) ) httperror.traceback ) )