Skip to content

Commit

Permalink
Merge pull request #6 from MohammadRezaAnsari/develop
Browse files Browse the repository at this point in the history
Add message to socket errors
  • Loading branch information
MohammadRezaAnsari authored Aug 3, 2021
2 parents 7a141f1 + bcd1488 commit dde7042
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Sources/SocketKit/Socket/SocketError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,13 @@ public enum SocketError: Error {
case channelExist
case noChannel
case parsingError(_ error: Error)

var message: String {
switch self {
case .emptyOption: return "There is no option."
case .channelExist: return "The channel currently is subscribing."
case .noChannel: return "There is no channel with given name."
case .parsingError(let error): return "Parsing event data got error: \(error.localizedDescription)"
}
}
}

0 comments on commit dde7042

Please sign in to comment.