equality checks for error and make them hashable