Thanks for this. I think you did this right considering that it's not possible to distinguish ROOTErrors at the type level. I use this sort of message checking technique outside of ROOT where it is necessary. Instead of `raise err` you should just say `raise` which will re-raise the original exception at the original location (i.e, it will show the exception originating from `canvas.SaveAs(...)`, which is what you want).