You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At some point (probably introducing cloud-next), we merged a regression in the HTTP API's error reporting, where now any errors in /database/publish will return a 500 with no body text. The CLI uses the response body text to print its error, so we get such gems as:
info: component 'rust-std' for target 'wasm32-unknown-unknown' is up to date
Compiling bitcraft-spacetimedb v0.1.0 (C:\ClockworkLabs\BitCraft\packages\game)
Finished release [optimized] target(s) in 1m 02s
checking crate with spacetimedb's clippy configuration
Compiling bitcraft-spacetimedb v0.1.0 (C:\ClockworkLabs\BitCraft\packages\game)
Finished dev [unoptimized + debuginfo] target(s) in 19.43s
Error:
I also notice that we return BAD_REQUEST for invalid credentials, rather than UNAUTHORIZED.
For at least the /database/publish route, and ideally the entire HTTP API surface:
Replace auth_or_bad_request with auth_or_unauth.
Replace log_and_500 with specific error response tuples of (STATUS_CODE, "Message"), where STATUS_CODE is an appropriate HTTP error code, and "Message" is a string describing what went wrong. The CLI will show that string to users on failure.
The text was updated successfully, but these errors were encountered:
At some point (probably introducing cloud-next), we merged a regression in the HTTP API's error reporting, where now any errors in
/database/publish
will return a 500 with no body text. The CLI uses the response body text to print its error, so we get such gems as:I also notice that we return
BAD_REQUEST
for invalid credentials, rather thanUNAUTHORIZED
.For at least the
/database/publish
route, and ideally the entire HTTP API surface:auth_or_bad_request
withauth_or_unauth
.log_and_500
with specific error response tuples of(STATUS_CODE, "Message")
, whereSTATUS_CODE
is an appropriate HTTP error code, and"Message"
is a string describing what went wrong. The CLI will show that string to users on failure.The text was updated successfully, but these errors were encountered: