fluree / core

Fluree releases and public bug reports
0 stars 0 forks source link

Improved error message when querying a ledger that doesn't exist #83

Open Jackamus29 opened 5 months ago

Jackamus29 commented 5 months ago

Is your feature request related to a problem? Please describe. I had a mismatch in my ledger names between my create transaction and my follow-up query. The result from fluree/server:latest was a 500 error with the body:

{
  "error": "Cannot invoke \"Object.toString()\" because \"s\" is null"
}

Describe the solution you'd like A typical response from an API when a resource is not found is a 404 error code. A response body with a nice error message that includes the missing ledger name that was provided would be great.

aaj3f commented 4 months ago

Also adding this as a "bug" because @jdorety discovered that, after receiving this error, it is actually impossible to create a ledger with the same name: https://fluree-internal.slack.com/archives/C04AA19P3FW/p1707148188337119?thread_ts=1707145653.275229&cid=C04AA19P3FW