diff --git a/errors/types.go b/errors/types.go index 09243f0c..5c806ffb 100644 --- a/errors/types.go +++ b/errors/types.go @@ -1,5 +1,5 @@ // -// Copyright (C) 2020 IOTech Ltd +// Copyright (C) 2020-2021 IOTech Ltd // // SPDX-License-Identifier: Apache-2.0 @@ -34,6 +34,8 @@ const ( KindRangeNotSatisfiable ErrKind = "RangeNotSatisfiable" KindClientError ErrKind = "ClientError" KindIOError ErrKind = "IOError" + KindOverflowError ErrKind = "OverflowError" + KindNaNError ErrKind = "NaNError" ) // Error codes are not defined in HTTP status codes @@ -186,7 +188,7 @@ func getCallerInformation() string { // codeMapping determines the correct HTTP response code for the given error kind. func codeMapping(kind ErrKind) int { switch kind { - case KindUnknown, KindDatabaseError, KindServerError: + case KindUnknown, KindDatabaseError, KindServerError, KindOverflowError, KindNaNError: return http.StatusInternalServerError case KindCommunicationError: return http.StatusBadGateway