Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Cocoa
- var statusCode: String = "401"
- var errorString: String
- switch statusCode {
- case "400", "404":
- // If we have a "Bad Request" or "Not Found" error
- errorString = "The request was invalid, please double-check your URL"
- case "401":
- // If we have an "Unauthorized" error
- errorString = "Your request failed for reasons of authorization, please check your username and password"
- case "403":
- // If we have a "Forbidden" error
- errorString = "Your request failed since you don't have the necessary permissions, please contact the administrator"
- default:
- errorString = "Unexpected error of type: \(statusCode)"
- }
- print(errorString)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement