diff --git a/Sources/FigmaExport/Output/VectorDrawableConverter.swift b/Sources/FigmaExport/Output/VectorDrawableConverter.swift index 2345c144..a3af34dc 100644 --- a/Sources/FigmaExport/Output/VectorDrawableConverter.swift +++ b/Sources/FigmaExport/Output/VectorDrawableConverter.swift @@ -24,7 +24,11 @@ final class VectorDrawableConverter { let outputString = String(decoding: outputData, as: UTF8.self) // Only log last line out standard output outputString.lastLine.flatMap { logger.info("\($0)") } - + + if error.contains("Unable to locate a Java Runtime") { + throw FigmaExportError.custom(errorString: error) + } + if error.contains(Self.notSupportedWarning) { logger.warning("vd-tool reported unsupported xml tags. Executing vd-tool for each file...") let enumerator = FileManager.default.enumerator(at: inputDirectoryUrl, includingPropertiesForKeys: nil) diff --git a/Sources/FigmaExport/main.swift b/Sources/FigmaExport/main.swift index bc627a60..71560f2c 100644 --- a/Sources/FigmaExport/main.swift +++ b/Sources/FigmaExport/main.swift @@ -9,6 +9,7 @@ enum FigmaExportError: LocalizedError { case componentsNotFound case accessTokenNotFound case colorsAssetsFolderNotSpecified + case custom(errorString: String) var errorDescription: String? { switch self { @@ -22,6 +23,8 @@ enum FigmaExportError: LocalizedError { return "Environment varibale FIGMA_PERSONAL_TOKEN not specified." case .colorsAssetsFolderNotSpecified: return "Option ios.colors.assetsFolder not specified in configuration file." + case .custom(let errorString): + return errorString } } }