OpenAPITools / OpenAPITools/openapi-generator
[SWIFT4] How to handle Error
Open
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
My code looks like this:
AuthAPI.login(loginRequest: request) { (response : LoginResponse?, error : Error?) in if error != nil { } if response != nil { if response!.result.success { self.loginSuccess(data: response!.result.data!) } } }
How can i get the http status code from error if there is one ?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the generated Swift 4 AuthAPI.login entry point shown in the issue and inspect the callback's Error type and response handling. No generated file or test is named; done would be a documented, verified way to access the HTTP status code, or a clear statement that the client does not expose it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- api
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100