File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,13 @@ func lintMain(configuration: Configuration, path: String) -> Int {
37
37
return 1
38
38
}
39
39
catch {
40
+ // Workaround: we're unable to directly catch unknownTokenKind errors due to access
41
+ // restrictions. TODO: this can be removed when we update to Swift 5.0.
42
+ if " \( error) " == " unknownTokenKind( \" pound_error \" ) " {
43
+ stderrStream. write ( " Unable to lint \( path) : unknownTokenKind( \" pound_error \" ) \n " )
44
+ stderrStream. flush ( )
45
+ return 1
46
+ }
40
47
stderrStream. write ( " Unable to lint \( path) : \( error) \n " )
41
48
stderrStream. flush ( )
42
49
exit ( 1 )
@@ -81,6 +88,13 @@ func formatMain(
81
88
return 1
82
89
}
83
90
catch {
91
+ // Workaround: we're unable to directly catch unknownTokenKind errors due to access
92
+ // restrictions. TODO: this can be removed when we update to Swift 5.0.
93
+ if " \( error) " == " unknownTokenKind( \" pound_error \" ) " {
94
+ stderrStream. write ( " Unable to format \( path) : unknownTokenKind( \" pound_error \" ) \n " )
95
+ stderrStream. flush ( )
96
+ return 1
97
+ }
84
98
stderrStream. write ( " Unable to format \( path) : \( error) \n " )
85
99
stderrStream. flush ( )
86
100
exit ( 1 )
You can’t perform that action at this time.
0 commit comments