Skip to content

Commit

Permalink
Add custom error type for ServiceError
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmeichigo committed Mar 8, 2024
1 parent 69277ab commit 958e0c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class WordPressComBlogService {

let site = WordPressComSiteInfo(remote: response)
guard site.url != Constants.wordPressBlogURL else {
failure(WordPressOrgXMLRPCValidatorError.invalid)
failure(ServiceError.invalidWordPressAddress)
return
}
success(site)
Expand All @@ -63,5 +63,6 @@ extension WordPressComBlogService {

enum ServiceError: Error {
case unknown
case invalidWordPressAddress
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ private extension SiteAddressViewController {
self?.navigationController?.pushViewController(customUI, animated: true)
}
} else {
self.displayError(error, sourceTag: self.sourceTag)
self.displayError(message: Localization.invalidURL)
}
})
}
Expand Down

0 comments on commit 958e0c8

Please sign in to comment.