# just catch the error inside of main and possible add another function like you said. i dont really see what the problem is?
# so its up to you to decide if you're fine with the default logic (print error name and return trace to stderr) or if you want to do something else