Provide overloads that return error codes instead of throwing exceptions.