mirror of
https://github.com/apple/swift-nio
synced 2026-11-30 05:28:44 +00:00
Added file and line to NIOAsyncWriterError description (#2693)
Motivation: Even though NIOAsyncWriterError captures the file and line of the error they are internal and not printed in the description. Modifications: - made the 2 properties public - added them in the description Result: Users will be able to access and see the line number and file where a NIOAsyncWriterError occurred
This commit is contained in:
1 parent
2d840c586f
commit
05fbcace24
1 file changed
+3
-5
@@ -80,11 +80,9 @@ public struct NIOAsyncWriterError: Error, Hashable, CustomStringConvertible {
|
||||
@usableFromInline
|
||||
let _code: _Code
|
||||
|
||||
@usableFromInline
|
||||
var file: String
|
||||
public var file: String
|
||||
|
||||
@usableFromInline
|
||||
var line: Int
|
||||
public var line: Int
|
||||
|
||||
@inlinable
|
||||
init(_code: _Code, file: String, line: Int) {
|
||||
@@ -111,7 +109,7 @@ public struct NIOAsyncWriterError: Error, Hashable, CustomStringConvertible {
|
||||
|
||||
@inlinable
|
||||
public var description: String {
|
||||
"NIOAsyncWriterError.\(self._code.rawValue)"
|
||||
"NIOAsyncWriterError.\(self._code.rawValue): \(self.file):\(self.line)"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user