How we work
Load failed is not an error message
A sentence that is true of three different problems is not an error message. It is a shrug with good grammar.
We build this company in public, which means we tell you what we are doing while we are doing it, including the parts that go badly. This is one of those. Two systems broke on the same day, both of them passed their tests, and neither of them would say why.
What we were building, so this makes sense
We run two small sites with no servers behind them: static files in storage, a content delivery network in front, and a handful of functions that do the few things a static file cannot. One of those functions handles comments on articles. A reader writes something, the function stores it, and the author is notified so it can be read before it appears anywhere.
This week we added two things to it. A link in the notification email that opens one comment with its buttons, so moderating takes one tap instead of finding a key and typing it. And a notification that reaches a phone directly, so a comment does not sit unread until somebody is next at a desk.
Both were written alongside an AI assistant, which is how everything here is built and the thing this company is actually about. Not watching it work. Not handing it the keys. Working with it, the way you would work with a very fast colleague who has never seen your business before.
Both shipped. Both passed their tests. Both were broken.
The first one said: Nothing here
The one tap link went out in an email, was tapped, and opened a page that said Nothing here. This address does not open anything. Either the comment has already been deleted, or the link was changed on its way here.
It was not deleted. The link had not been changed. The comment was sitting in the database waiting to be read.
Look at that sentence for a moment, because it is the villain of this post. It is polite, it is well written, and it covers three completely different failures with one wording: the row is gone, the signature does not verify, or the page could not reach the server at all. Three causes, three different fixes, one message that distinguishes none of them.
A sentence that is true of three different problems is not an error message. It is a shrug with good grammar.
The actual fault, and why no test could have caught it
The function reads one comment by its two keys. In the database that is a different operation from the one used everywhere else in the system, with a different name, and therefore a different permission.
The code gained that operation. The role did not.
So the function asked for the row, the cloud provider refused, the function errored, and the page said nothing here. Everything else kept working perfectly, because everything else used the permissions that were already granted.
Now the part worth stealing. There were ninety four tests on this function at the time and every one of them passed. They still pass. They are good tests, and they could not possibly have caught this.
The reason is a design decision we would make again. The handler never talks to the database directly. It is given a store, and in the tests that store is a fake one, which is what lets the whole suite run in under a second with no cloud account, no network and no credentials. That is the right design.
But a fake store cannot refuse a permission. The tests proved the logic and were structurally incapable of proving the access.
Two lists existed. The operations in the code, and the permissions in the role. Nothing kept them in step except somebody noticing. We have written that sentence into the deployment document now, because the next function will have the same shape and the same gap.
The second one said: Load failed
So we fixed the permission, and then went to work on the notifications that were not arriving on the phone.
We added a button inside the product that says send a test notification, so the answer would arrive where the problem was, on the phone, rather than in a log file on a computer in another room. Pressed it. Got two words. Load failed.
That is not our wording. That is the browser's. And it is worth understanding exactly what it means, because it is one of the most misleading two word sentences in web development.
It does not mean the network is down. It means the browser was not allowed to read the answer it received.
When a function throws an exception that nothing catches, the platform returns a generic server error. That response is generated before our code runs, so it does not carry the cross origin headers our code attaches to every answer. Without those headers the browser refuses to let the page read the response at all, and reports it as a network failure.
So the server said something specific and useful. The browser was forbidden from showing it to us. We got two words that point nowhere.
The fix is three lines and a principle
The whole function is now wrapped. Nothing escapes it.
return async function handler(event) {
const origin = headerOf(event, 'origin') ?? '';
try {
return await route(event, origin);
} catch (err) {
console.error('handler threw:', err?.stack ?? err);
return reply(500, {
error: 'server_error',
detail: String(err?.message ?? err).slice(0, 300),
}, origin);
}
};
The important part is not the try and the catch. It is origin being passed into the failure reply. A message the browser cannot read is not a message. We wrote a test that asserts the cross origin header is present on the error response specifically, because that header is the difference between a sentence and a wall.
What it said once it could speak
We pressed the button again and got a real sentence: the keys were refused, the private key must be URL safe Base 64 without the equals sign, public 87 characters, private 56 characters.
A key of that type is forty three characters. Fifty six is thirteen too many, which is almost exactly the length of the label printed above it by the tool that generates it.
The label had been copied along with the key, into a console field, where it looked completely normal.
An evening of work, and the fault was thirteen characters of punctuation that nothing in the system was willing to describe out loud.
The function now trims those values before use, and when a key pair is rejected it reports the refusal with the length of each one, rather than throwing and taking the whole request down with it.
Three rules, and they are not about the cloud
None of this is particular to one provider, one language or one architecture. Three things come out of it that would have been true twenty years ago.
- <b>An error message that fits more than one cause is a bug.</b> Not a cosmetic problem, a bug, and usually the most expensive one in the system. If the same sentence can be true of three different failures, the person reading it has to go and investigate all three. Write a different sentence for each.
- <b>Nothing should be able to fail silently out of the top of your system.</b> Wrap the boundary. Return a real answer with a real message, and make sure that answer is one the caller is actually permitted to read. An exception that reaches the platform becomes a response you do not control.
- <b>Put the diagnosis where the person is.</b> Our logs were in the cloud console, which is useful on a laptop and useless when the broken device is a phone in your hand. The test button in the product took twenty minutes to build and ended an evening of guessing in one press.
The honest part, and it is not about who typed it
The obvious version of this story is that the assistant wrote the bug. That is not what happened and it is not a useful lesson.
Here, as always, it was a collaboration. Some days the assistant writes the code. Some days we do. On this one it does not matter, because the mistake would have been identical either way.
What actually happened is that the code was written against an assumption about which permissions existed. The tests were written against the same assumption, by design, because the fake store exists precisely so the tests do not depend on the real one. And the review was done against that same assumption, which is why the review passed.
That failure mode has nothing to do with who held the keyboard, and everything to do with whether anything in the room was looking at reality instead of at an agreed picture of it.
Three things agreed with each other. None of them had asked the cloud provider.
If you are building anything with AI right now
Working well with an assistant is not about writing better instructions. It is about making sure that something in the process is checking what actually happened, rather than what everybody expected to happen.
A fake store, a passing test and a confident review can all agree with each other and still be describing a system that does not exist. Something has to go and ask the real one.
And when it does not work, your system has one job: to tell you what it tried and what refused.
Guesses are charged by the hour. A system that says what it tried and what refused is the cheapest thing you will ever build.
MK!
Maria Catalina Kovacs
There is no tracking on this site. No analytics, no cookies, nothing recording where you went or how long you stayed.
But I would like to know if something here was worth your time. If it was, press the heart. It tells me nothing about you. It is a number going up, and it is what tells me to keep writing.
If you want more of this, I am on X. @Queendemetriak