Skip to content

Commit 0535f6f

Browse files
authored
alreadyExists returns the wrong code (#9955)
- is an alias for HTTP 409 Conflict. This can be confirmed via any HTTP query tool (e.g. Postman) - value "ALREADY_EXISTS" should return .alreadyExists, not .notFound.
1 parent d1cb6d1 commit 0535f6f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

FirebaseFunctions/Sources/FunctionsError.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ internal func FunctionsCodeForHTTPStatus(_ status: NSInteger) -> FunctionsErrorC
121121
case 404:
122122
return .notFound
123123
case 409:
124-
return .aborted
124+
return .alreadyExists
125125
case 429:
126126
return .resourceExhausted
127127
case 499:
@@ -148,7 +148,7 @@ extension FunctionsErrorCode {
148148
case "INVALID_ARGUMENT": return .invalidArgument
149149
case "DEADLINE_EXCEEDED": return .deadlineExceeded
150150
case "NOT_FOUND": return .notFound
151-
case "ALREADY_EXISTS": return .notFound
151+
case "ALREADY_EXISTS": return .alreadyExists
152152
case "PERMISSION_DENIED": return .permissionDenied
153153
case "RESOURCE_EXHAUSTED": return .resourceExhausted
154154
case "FAILED_PRECONDITION": return .failedPrecondition

0 commit comments

Comments
 (0)