From b86f4b4637aea8d83d5752bb051a04ce3394889b Mon Sep 17 00:00:00 2001 From: Yi Wang Date: Mon, 1 Apr 2019 15:46:53 -0700 Subject: [PATCH] Use print and exit to repot error (#28) Using `fatalError` cannot be captured by a script that is used to integrate with build systems. --- Validator/Sources/abstractclassvalidator/ValidateCommand.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Validator/Sources/abstractclassvalidator/ValidateCommand.swift b/Validator/Sources/abstractclassvalidator/ValidateCommand.swift index 2dca542..65d0a7f 100644 --- a/Validator/Sources/abstractclassvalidator/ValidateCommand.swift +++ b/Validator/Sources/abstractclassvalidator/ValidateCommand.swift @@ -66,7 +66,8 @@ class ValidateCommand: AbstractCommand { do { try Validator().validate(from: sourceRootPaths, withSourcesListFormat: sourcesListFormat, excludingFilesEndingWith: excludeSuffixes, excludingFilesWithPaths: excludePaths, shouldCollectParsingInfo: shouldCollectParsingInfo, timeout: timeout, concurrencyLimit: concurrencyLimit) } catch GenericError.withMessage(let message) { - fatalError(message) + print(message) + exit(1) } catch { fatalError("Unknown error: \(error)") }