Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo #34

Merged
merged 1 commit into from
Jan 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public func routes(_ router: Router) throws {
return try s3.create(bucket: "api-created-bucket", region: .euCentral1, on: req).map(to: String.self) {
return ":)"
}.catchMap({ (error) -> (String) in
if let error = error.s3ErroMessage() {
if let error = error.s3ErrorMessage() {
return error.message
}
return ":("
Expand Down Expand Up @@ -195,7 +195,7 @@ public func routes(_ router: Router) throws {
return try s3.delete(bucket: "api-created-bucket", region: .euCentral1, on: req).map(to: String.self) {
return ":)"
}.catchMap({ (error) -> (String) in
if let error = error.s3ErroMessage() {
if let error = error.s3ErrorMessage() {
return error.message
}
return ":("
Expand All @@ -207,7 +207,7 @@ public func routes(_ router: Router) throws {
router.get("files") { req -> Future<BucketResults> in
let s3 = try req.makeS3Client()
return try s3.list(bucket: "booststore", region: .usEast1, headers: [:], on: req).catchMap({ (error) -> (BucketResults) in
if let error = error.s3ErroMessage() {
if let error = error.s3ErrorMessage() {
print(error.message)
}
throw error
Expand Down Expand Up @@ -242,7 +242,7 @@ public func routes(_ router: Router) throws {
let json = try JSONEncoder().encode(infoResponse)
return String(data: json, encoding: .utf8) ?? "Unknown content!"
}.catchMap({ error -> (String) in
if let error = error.s3ErroMessage() {
if let error = error.s3ErrorMessage() {
return error.message
}
return ":("
Expand Down
4 changes: 2 additions & 2 deletions Sources/S3/Extensions/Error+S3.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ extension Error {
}

/// Return S3 ErrorMessage if possible
public func s3ErroMessage() -> ErrorMessage? {
public func s3ErrorMessage() -> ErrorMessage? {
guard let error = self as? S3.Error else {
return nil
}
Expand All @@ -33,7 +33,7 @@ extension Error {
}

/// Return S3 error status code if possible
public func s3ErroCode() -> HTTPResponseStatus? {
public func s3ErrorCode() -> HTTPResponseStatus? {
guard let error = self as? S3.Error else {
return nil
}
Expand Down
10 changes: 5 additions & 5 deletions Sources/S3DemoApp/S3DemoApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public func routes(_ router: Router) throws {
return try s3.create(bucket: "api-created-bucket", region: .euCentral1, on: req).map(to: String.self) {
return ":)"
}.catchMap({ (error) -> (String) in
if let error = error.s3ErroMessage() {
if let error = error.s3ErrorMessage() {
return error.message
}
return ":("
Expand All @@ -31,7 +31,7 @@ public func routes(_ router: Router) throws {
return try s3.delete(bucket: "api-created-bucket", region: .euCentral1, on: req).map(to: String.self) {
return ":)"
}.catchMap({ (error) -> (String) in
if let error = error.s3ErroMessage() {
if let error = error.s3ErrorMessage() {
return error.message
}
return ":("
Expand All @@ -43,7 +43,7 @@ public func routes(_ router: Router) throws {
router.get("files") { req -> Future<BucketResults> in
let s3 = try req.makeS3Client()
return try s3.list(bucket: "booststore", region: .usEast1, headers: [:], on: req).catchMap({ (error) -> (BucketResults) in
if let error = error.s3ErroMessage() {
if let error = error.s3ErrorMessage() {
print(error.message)
}
throw error
Expand Down Expand Up @@ -93,7 +93,7 @@ public func routes(_ router: Router) throws {
let json = try JSONEncoder().encode(infoResponse)
return String(data: json, encoding: .utf8) ?? "Unknown content!"
}.catchMap({ error -> (String) in
if let error = error.s3ErroMessage() {
if let error = error.s3ErrorMessage() {
return error.message
}
return ":("
Expand All @@ -102,7 +102,7 @@ public func routes(_ router: Router) throws {
}
}
}.catchMap({ error -> (String) in
if let error = error.s3ErroMessage() {
if let error = error.s3ErrorMessage() {
return error.message
}
return ":("
Expand Down