Home / Diary of a solo dev building a web app / Tech note: JavaScript debugging helpers edit
Try Documentalist, my app that offers fast, offline access to 190+ programmer API docs.

This is a dev diary of implementing Filerion, a web-based file manager for online storage (Dropbox, OneDrive, Google Drive, s3 and more).A tech note is a deeper description of some technical problem I’ve encountered and solved.
Let’s say you want to test handling of failing API backend call. Unfortunately it’s not easy to trigger.
How to make it easier to trigger? We can modify the code to introduce a buggy invocation. That works but what if we want to do it in the feature, without modifying the code all the time?
What I do is: I add window.debug object that exposes a bunch of functions that help in debugging the app.
It could be listing information internal to the app.
It could be setting a flag to change app’s behavior.
It could be forcing the next API call to fail to exercise handling of failures.
Those functions can be called in dev tools console.

Feedback about page:

Optional: your email if you want me to get back to you:

Need fast, offline access to 190+ programmer API docs? Try my app Documentalist for Windows