Skip to content

Commit 19d3afa

Browse files
committed
Update
1 parent dab7629 commit 19d3afa

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Sources/TSCUtility/Diagnostics.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ extension DiagnosticsEngine {
109109
return nil
110110
}
111111
}
112-
112+
113113
/// Wrap a throwing closure, returning a success boolean and
114114
/// emitting any thrown errors.
115115
///
@@ -139,7 +139,7 @@ extension Optional where Wrapped == DiagnosticsEngine {
139139
if case let diagnostics? = self {
140140
diagnostics.emit(.error(error), location: location)
141141
} else {
142-
throw Diagnostics.fatalError
142+
throw StringError(error)
143143
}
144144
}
145145

@@ -150,7 +150,7 @@ extension Optional where Wrapped == DiagnosticsEngine {
150150
if case let diagnostics? = self {
151151
diagnostics.emit(error, location: location)
152152
} else {
153-
throw Diagnostics.fatalError
153+
throw error
154154
}
155155
}
156156

@@ -161,7 +161,7 @@ extension Optional where Wrapped == DiagnosticsEngine {
161161
if case let diagnostics? = self {
162162
diagnostics.emit(.error(convertible.diagnosticData), location: location)
163163
} else {
164-
throw Diagnostics.fatalError
164+
throw StringError(convertible.diagnosticData.description)
165165
}
166166
}
167167

@@ -172,7 +172,7 @@ extension Optional where Wrapped == DiagnosticsEngine {
172172
if case let diagnostics? = self {
173173
diagnostics.emit(message, location: location)
174174
} else if message.behavior == .error {
175-
throw Diagnostics.fatalError
175+
throw StringError(message.text)
176176
}
177177
}
178178
}

0 commit comments

Comments
 (0)