Ember: Decoding failure is a server error
See original GitHub issueWith the ember server, CirceEntityCodec
’s default behavior seems to fail any request that doesn’t successfully decode, but with an InternalServerError by default.
To reproduce:
scala-cli https://gist.github.com/kubukoz/351c19621d475c319ab1d0a178bf9bf7
In another tab:
http post :8080/foo a=b -v
POST /foo HTTP/1.1
Accept: application/json, */*;q=0.5
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Length: 10
Content-Type: application/json
Host: localhost:8080
User-Agent: HTTPie/2.6.0
{
"a": "b"
}
HTTP/1.1 500 Internal Server Error
Connection: keep-alive
Content-Length: 0
Date: Thu, 20 Jan 2022 16:26:32 GMT
I think this is caused by Ember using a default error handler which transforms every throwable into a 500, whereas Blaze’s special-cases MessageFailure - is there a specific reason why that’s so, or should Ember be updated to behave the same?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
JWT payload is not decoded properly #216 - GitHub
... this error when ember-simple-auth-token tries to decode the jwt received from the server Failed to execute 'atob' on 'Window': The stri.
Read more >ServerError - 4.7 - Ember API Documentation
A ServerError equates to a HTTP 500 Internal Server Error response status. It is used by the adapter to indicate that a request...
Read more >Failed to decode downloaded font - ember-cli (3.7.1)
I'm facing this font decoding issue after I deploy ember cli app to heroku. It works fine in my localhost. I'm using @font-face...
Read more >Why ember test –server was failing | Our Craft - WordPress.com
When I tried to run ember test --server on my Linux machine I got the following: $ ember test --server DEPRECATION: Overriding init...
Read more >Setting up Custom Authorization in Ember-CLI using Google ...
The problem is that upon authentication, Ember Simple Auth lets the user access secure routes. In other words, /s/notes can be transitioned to ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I chose not to do that to put more things into user space. Whether or not people want to hold consistent with that is a larger question. The point was to have ember put middlewares in users hands to get normal behavior visible and present in things like metrics, which would otherwise be invisible.
Either the server needs to be more a lot more powerful to hold more triggers and remove control from the user, or weaker and put more things into user space. I chose to make it do less and put things into user space and added the ErrorHandling middleware so users could do this themselves.
Where blaze is at is inconsistent and often ends up confusing.
I can throw together something for a common Middlewares in a builder pattern approach. Then we can bike shed on the flavor from at least a proposal.
I think if we get this all the backends can simplify, and we’ll be consistent.
Not sure what server TCK means sorry.