added domain-based error handling to prevent app crashes when errors are thrown from success callbacks