question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ember: Decoding failure is a server error

See original GitHub issue

With 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:open
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
ChristopherDavenportcommented, Feb 8, 2022

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.

1reaction
ChristopherDavenportcommented, Feb 9, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found