error handling register, error type as parameter