Skip to content

Commit

Permalink
fix error todo
Browse files Browse the repository at this point in the history
  • Loading branch information
waahm7 committed Nov 21, 2024
1 parent e3c25d8 commit 443bbc5
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions Source/AwsCommonRuntimeKit/crt/CBOR.swift
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,7 @@ public class CBORDecoder {
guard
out_value == 1
else {
// TODO: fix error
throw CommonRunTimeError.crtError(.makeFromLastError())
throw CommonRunTimeError.crtError(CRTError(code: AWS_ERROR_CBOR_UNEXPECTED_TYPE.rawValue))
}
let timestamp = try popNext()

Expand All @@ -251,8 +250,7 @@ public class CBORDecoder {
} else if case .int(let value) = timestamp {
return .date(Date.init(timeIntervalSince1970: Double(value)))
} else {
// TODO: fix error
throw CommonRunTimeError.crtError(.makeFromLastError())
throw CommonRunTimeError.crtError(CRTError(code: AWS_ERROR_CBOR_UNEXPECTED_TYPE.rawValue))
}
case AWS_CBOR_TYPE_ARRAY_START:
var out_value: UInt64 = 0
Expand Down Expand Up @@ -281,8 +279,7 @@ public class CBORDecoder {
if case .text(let key) = key {
map[key] = try popNext()
} else {
// TODO: fix error
throw CommonRunTimeError.crtError(.makeFromLastError())
throw CommonRunTimeError.crtError(CRTError(code: AWS_ERROR_CBOR_UNEXPECTED_TYPE.rawValue))
}
}
return .map(map)
Expand Down

0 comments on commit 443bbc5

Please sign in to comment.