Skip to content

Commit

Permalink
Merge pull request LiveUI#34 from 131e55/fix/typo
Browse files Browse the repository at this point in the history
Fix typo
  • Loading branch information
rafiki270 authored Jan 17, 2019
2 parents 528112a + 37eaa11 commit 0b8b969
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
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

0 comments on commit 0b8b969

Please sign in to comment.