Handle error types as well