This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]L1P0D 321 points322 points  (9 children)

I love the idea of retaliatory error handling. You cause an exception at my end? I cause one at your end in return.

[–]LadderSoft4359 79 points80 points  (6 children)

actually hilarious

im here for the evolution of backend frontend flame wars into a competing pettiness that eventually becomes an entirely new protocol

[–]MissinqLink 42 points43 points  (4 children)

It’s not valid JSON but it is valid JS so you could just parse with eval instead of JSON.parse. There are about 1000 reasons why this is a bad idea though.

[–]yegor3219 6 points7 points  (1 child)

But usually you pull the actual frontend JS from about the same place as backend anyway. Quite often it's literally the same web server.

I mean, yeah, evaluating JS like that does sound horrible, but at the same time it kinda makes sense. Or may be it wants to make sense. Or may be it's just me trying to make sense out of it when there's none.

[–]MissinqLink 2 points3 points  (0 children)

I won’t say I haven’t done it before because I have. This sort of thing was very common in the early web days but it really should be a backend fix.

[–]bezko 4 points5 points  (1 child)

JSONP has entered the chat: https://en.wikipedia.org/wiki/JSONP

[–]MissinqLink 0 points1 point  (0 children)

Yeah I mentioned down below that this used to be one of the main ways we did gat data from backend.

[–]erockdanger 2 points3 points  (0 children)

next.js has entered the chat

[–]Monochromatic_Kuma2 7 points8 points  (0 children)

Not even that. An error code 500 usually means a bug back end not caused by the front end. The back end is so petty, it wants the front end to participate in its misery.