Allow inheritance in error classes.

When registering an error, it is nice to be able to provide a 'supererror' that this error should extend.