Menu

Your error handling has never met a real 503. Here's how to introduce them.
📰

Your error handling has never met a real 503. Here's how to introduce them.

DEV Community: mobile·moath othman·3 days ago
#SshHuIT3
#devtomobile#devto#dev#proxy#retry
Reading 0:00
15s threshold

Staging is a terrible place to test failure. It only ever produces the happy path, so the code that handles timeouts, 500s and retries is the least-executed code in most apps, right up until production executes it for you.

This post is a practical way to fix that without changing the backend or the app: make the failures happen at the proxy, between the two.

Three kinds of failure worth testing

Slow. The request succeeds, eventually. What does the UI show at 200 ms, at 3 seconds, at 30? Is there a spinner, a timeout, a way out? Does the user tap the button twice?

Broken. 500, 502, 503, a dropped connection. Does the app retry, and how often? Does it honour Retry-After ? On a checkout, does a retry charge the card twice?

Wrong. The one people skip. An HTTP 200 with bad data inside: a price that arrives as "49.00" instead of 49.00 , a field that is suddenly null , an empty list on a screen that always had one item.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.