Added unit tests re the new error handling