Skip to content

Commit

Permalink
update error validation
Browse files Browse the repository at this point in the history
  • Loading branch information
xiazhvera committed Jun 12, 2024
1 parent e377204 commit fdcc698
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/AwsCommonRuntimeKit/crt/CommonRuntimeError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public struct CRTError: Equatable {
public let name: String

public init<T: BinaryInteger>(code: T) {
if code > INT32_MAX || code <= 0 {
if code > INT32_MAX || code < 0 {
self.code = Int32(AWS_ERROR_UNKNOWN.rawValue)
} else {
self.code = Int32(code)
Expand All @@ -24,7 +24,7 @@ public struct CRTError: Equatable {
}

public init<T: BinaryInteger>(code: T, context: String?) {
if code > INT32_MAX || code <= 0 {
if code > INT32_MAX || code < 0 {
self.code = Int32(AWS_ERROR_UNKNOWN.rawValue)
} else {
self.code = Int32(code)
Expand Down

0 comments on commit fdcc698

Please sign in to comment.