Disable PhotoStructure from "failing fast"

First, some background:

In building PhotoStructure, as I came up with error conditions, I had to decide which errors should be “ignorable”, or “warnings,” or “fatal.” Fatal errors are when continuing on doesn’t really make a lot of sense. If the directory holding your PhotoStructure library disappears, for example, PhotoStructure can’t serve your library, so I figured it would be reasonable to shut down.

By respecting these fatal errors, I made PhotoStructure “fail fast”, which is a programming mantra from unix.

While I was helping someone with their installation today I realized that most people aren’t :nerd_face: always tailing their logs in a background terminal (like I am during development).

They spin up their docker container, or they double-click the desktop app, and if PhotoStructure shuts down before you ask it too, that’s not “acting cautiously” and “failing early.” To most people, I bet, “PhotoStructure crashed.”

So. That’s no good.

PhotoStructure already can collect recent errors (it’s what’s used for Sentry error reports).

What I realized this afternoon was that PhotoStructure could make those errors as obvious as possible: and it’d probably be easiest if those errors were just shown on the home page, or at least a notification to a logs page was prominent.

So: I’ll try to code this up quickly and get it into the next build.

If you have any feedback around this issue, including UX that you’ve seen that handles this well, please reply and share!

1 Like

I don’t have any formal programming background, so maybe I’m missing something…

But I don’t understand why you would kill the frontend unless an error made serving the frontend impossible. The frontend is what the user is interacting with (not the logs, as you pointed out). As long as the frontend is available, I agree that it should be used to display any relevant error messages that impact the core functionality of Photostructure.

In other words, I agree with your assessment. :slight_smile: Keep up the good work!

You’re correct. That’s the jist.

I conflated “serve something reasonable (like the contents of the library)” with “serve anything (like an error message saying what’s wrong)”.