st-flash: Improve error handling