Pulled this out of a talk by Avdi. This technique is described at 16:00 in the video.
It’s nice for the user of a library to be able to catch any error coming out of the library, but at the same time, it’s nice for a library to pass through basic error types like HTTPError. To solve the problem, you can “tag” the HTTPError with your own error class, essentially raising both types of error: