Page MenuHomePhabricator

Investigate: Implement error handling
Closed, ResolvedPublic13 Estimated Story Points

Description

After T325633: Investigate: Log and store errors, we'll need to implement the error handling where necessary. Please investigate and write up tickets for this work. Some work I'm assuming will need to be done (not exhaustive and please verify):

  • If the API call to the vendor fails
  • writes to the db that fail
  • calls to the endpoints that fail

Event Timeline

Restricted Application added a subscriber: Aklapper. ยท View Herald TranscriptDec 20 2022, 2:05 PM
Niharika set the point value for this task to 13.Dec 20 2022, 5:31 PM

Having discussed with @STran:

  • If the API call to the vendor fails

Will be done as part of T325630: Implement call to data vendor

  • writes to the db that fail

Handled in T338016: Catch errors when inserting data for individual IP addresses into the database

  • calls to the endpoints that fail

Will check the coverage of this here.

  • calls to the endpoints that fail

Will check the coverage of this here.

I tried a bunch of bad requests:

Type of problemExample response text
No IP (bad URL)Cannot GET /feed/v1/ip
IP not in databaseNo data found for 46.246.41.16
Badly formed IPNo data found for hello
JavaScript error{"status":500,"type":"internal_error","title":"TypeError","detail":"Cannot read property 'includes' of undefined","method":"GET","uri":"/feed/v1/ip/46.246.41.167"}
SQL error{"status":500,"type":"internal_error","title":"Error","detail":"(conn=737, no: 1064, SQLState: 42000) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1\nsql: \n SELECT * FROM behaviors WHERE pkid IN ( ? );\n SELECT * FROM proxies WHERE pkid IN ( ? );\n SELECT * FROM tunnels WHERE pkid IN ( );\n - parameters:['1','1']","method":"GET","uri":"/feed/v1/ip/46.246.41.167"}

@STran Does this look OK as-is?