Skip to content

Commit

Permalink
Make JSONRPC2Error codes public
Browse files Browse the repository at this point in the history
  • Loading branch information
loopedresolve committed Jul 22, 2024
1 parent 0b6e501 commit aa977b9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions Sources/JSONRPC2/Public/JSONRPC2Error.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import JSON

*/
public struct JSONRPC2Error: Error {
let code: Int
let message: String
let errorInfo: JSON?
public let code: Int
public let message: String
public let errorInfo: JSON?
}

extension JSONRPC2Error: Codable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ extension JSONRPC2Error {
[JSON-RPC 2.0](https://www.jsonrpc.org/specification)

*/
typealias Code = Int
public typealias Code = Int
}

extension JSONRPC2Error.Code {
static let parseError = -32700
static let invalidRequest = -32600
static let methodNotFound = -32601
static let invalidParams = -32602
static let internalError = -32603
public static let parseError = -32700
public static let invalidRequest = -32600
public static let methodNotFound = -32601
public static let invalidParams = -32602
public static let internalError = -32603
}

extension JSONRPC2Error {
static let serverError = (-32099 ... -32000)
public static let serverError = (-32099 ... -32000)
}

0 comments on commit aa977b9

Please sign in to comment.