nickva commented on a change in pull request #13: URL: https://github.com/apache/couchdb-erlfdb/pull/13#discussion_r571457332
########## File path: src/erlfdb_error.erl ########## @@ -0,0 +1,152 @@ +% Licensed under the Apache License, Version 2.0 (the "License"); you may not +% use this file except in compliance with the License. You may obtain a copy of +% the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +% License for the specific language governing permissions and limitations under +% the License. + +-module(erlfdb_error). + +-export([ + error_name/1 +]). + +error_name(0) -> Review comment: What do you think about adding a catch-all clause to account for new errors? At least we'd get an error code instead of a clause error. For example, I looked in FDB master and saw a few more error codes not include here: https://github.com/apple/foundationdb/blob/master/flow/error_definitions.h ``` ERROR( invalid_cache_eviction_policy, 2024, "Invalid cache eviction policy, only random and lru are supported" ) ERROR( network_cannot_be_restarted, 2025, "Network can only be started once" ) ERROR( blocked_from_network_thread, 2026, "Detected a deadlock in a callback called from the network thread" ) ``` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
