This PR adds the ability to handle errors and exceptions.
Added few appropriate Exception classes
Added related exception handlers
Raise the proper exceptions
This ensures that a user never has to see an error message like this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>500 Internal Server Error</title>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>
Instead, the response will always be a JSON, even in the case of errors on the server:
{
"error": {
"message": "SciGraph dynamic/cliqueLeader yields no result for PMID:28847661",
"code": 400,
"debug": {}
}
}
This is an initial take at better handling and propagating the underlying problem to the user.
Even if Ontobio encounters an exception, there is now a default exception handler in BioLink API that will handle it.
This PR adds the ability to handle errors and exceptions.
This ensures that a user never has to see an error message like this:
Instead, the response will always be a JSON, even in the case of errors on the server:
This is an initial take at better handling and propagating the underlying problem to the user.
Even if Ontobio encounters an exception, there is now a default exception handler in BioLink API that will handle it.