calpoly-csai / api

Official API for the NIMBUS Voice Assistant accessible via HTTP REST protocol.
https://nimbus.api.calpolycsai.com/
GNU General Public License v3.0
9 stars 4 forks source link

Iss182 catchall logger #186

Closed ethanahlquist closed 4 years ago

ethanahlquist commented 4 years ago

What's New?

I think this is good, but review would be greatly appreciated

Branch includes changes to allow generic error handling, presumably for all cases. In the SQL database, questions and their stacktraces are stored in the ErrorLog table. This error catching much more elegant. Caught stacktraces are still printed into stdout also.

Changes include:

Fixes #182

Type of change (pick-one)

How Has This Been Tested?

I have seen correct ErrorLogs in the SQL database, after running:

curl --location --request POST 'localhost:8080/ask' --header 'Content-Type: application/json' --data-raw '{ "question": "When CPE 233?" }'

Which caused a KeyError in nimbus.answer_question(question)

I have also tested with functioning requests

Checklist (check-all-before-merge)

formatting help: - [x] means "checked' and - [ ] means "unchecked"

sonarcloud[bot] commented 4 years ago

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication