The error message is part of the experience
There's a small detail in software development that doesn't always receive enough attention.
What happens when something doesn't work?
Developers often spend most of their time making the successful workflow function correctly. That's understandable. A feature needs to work before anything else matters.
But file-processing applications have an unusual problem: users can provide an enormous variety of inputs.
Two files with the same extension can have completely different internal structures.
A document might be damaged, encrypted, incomplete, or simply unsupported.
When something goes wrong, the application needs to communicate that clearly.
I've encountered this repeatedly while developing Pocket PDF.
Why generic errors aren't enough
Imagine someone selects a PDF and receives this message:
"Processing failed."
What should they do next?
Try another browser? Choose another file? Remove the password? Check whether the document is damaged?
The message doesn't provide enough information.
Compare that with:
"This PDF appears to be password-protected. Remove the password before trying again."
The second message gives the user a possible explanation and a next step.
That's a much better experience.
Of course, applications shouldn't claim to know the exact cause when they cannot establish it.
A useful error message should be specific without pretending to have information it doesn't possess.
Separate different failure conditions
One practical improvement is to identify different failure categories instead of treating everything as the same exception.
For a file-processing application, these might include:
Invalid input
The selected file doesn't match the expected format or cannot be parsed.
Unsupported input
The file is valid, but the application doesn't support a particular feature or encoding.
Resource limitations
The operation requires more memory or processing capacity than the current environment can provide.
Processing failures
The underlying library encountered an unexpected problem.
User cancellation
The operation was intentionally stopped.
These conditions should not necessarily produce the same message.
Don't expose unnecessary technical details
Developers need useful diagnostic information.
Users need understandable explanations.
Those are two different requirements.
A stack trace might help identify a programming error, but displaying it directly to someone trying to compress an image isn't helpful.
A better approach is to record appropriate diagnostic information for development while showing a concise, understandable message in the interface.
Be careful not to include sensitive file contents in diagnostic logs.
Recovery matters too
An error message shouldn't always be the end of the workflow.
Depending on the situation, the application might allow someone to:
Select another file.
Retry the operation.
Reduce the processing workload.
Choose a supported output format.
Return to the previous screen.
The best recovery option depends on the actual failure.
It's also important to reset temporary application state properly. Otherwise, one failed operation can interfere with the next attempt.
A small detail with a big impact
While developing Pocket PDF, I've become increasingly interested in these less visible parts of software.
A successful conversion is important, but a useful application should also behave sensibly when the conversion fails.
Users don't expect every file to work.
They do expect the application to tell them what's happening.
How do you approach error handling in your own applications? Do you design failure states early, or add them after the main functionality is working?
You can explore Pocket PDF at https://www.pocketpdf.site.
Top comments (1)
Some comments may only be visible to logged-in visitors. Sign in to view all comments.