Do you know what errors could occur here?

I think it might be better to log it to `console.error` instead of a dialog to start with.