diff --git a/src/convert/metadataConverter.ts b/src/convert/metadataConverter.ts index 1fe0f9da7e..c5d1bbe34a 100644 --- a/src/convert/metadataConverter.ts +++ b/src/convert/metadataConverter.ts @@ -8,6 +8,7 @@ import { Readable, PassThrough } from 'stream'; import { dirname, join, normalize } from 'path'; import { Messages, SfError } from '@salesforce/core'; import { promises } from 'graceful-fs'; +import { isString } from '@salesforce/ts-types'; import { SourceComponent } from '../resolve'; import { ensureDirectoryExists } from '../utils/fileSystemHandler'; import { SourcePath } from '../common'; @@ -133,13 +134,12 @@ export class MetadataConverter { result.converted = (writer as StandardWriter).converted; } return result; - } catch (e) { - throw new SfError( - messages.getMessage('error_failed_convert', [(e as Error).message]), - 'ConversionError', - [], - e as Error - ); + } catch (err) { + if (!(err instanceof Error) && !isString(err)) { + throw err; + } + const error = isString(err) ? new Error(err) : err; + throw new SfError(messages.getMessage('error_failed_convert', [error.message]), 'ConversionError', [], error); } } } diff --git a/test/nuts/perfResults/x64-linux-2xIntel-Xeon-Platinum-8272CL-CPU-2-60GHz/eda.json b/test/nuts/perfResults/x64-linux-2xIntel-Xeon-Platinum-8272CL-CPU-2-60GHz/eda.json index a2bd44fe6a..8e1db8e72b 100644 --- a/test/nuts/perfResults/x64-linux-2xIntel-Xeon-Platinum-8272CL-CPU-2-60GHz/eda.json +++ b/test/nuts/perfResults/x64-linux-2xIntel-Xeon-Platinum-8272CL-CPU-2-60GHz/eda.json @@ -1,18 +1,18 @@ [ { "name": "componentSetCreate", - "duration": 210.39633800002048 + "duration": 206.68928799999412 }, { "name": "sourceToMdapi", - "duration": 5190.605087999953 + "duration": 6456.049191999991 }, { "name": "sourceToZip", - "duration": 5046.684008000011 + "duration": 5368.473570999995 }, { "name": "mdapiToSource", - "duration": 3791.2770250000176 + "duration": 3560.2728149999894 } ] \ No newline at end of file diff --git a/test/nuts/perfResults/x64-linux-2xIntel-Xeon-Platinum-8272CL-CPU-2-60GHz/lotsOfClasses.json b/test/nuts/perfResults/x64-linux-2xIntel-Xeon-Platinum-8272CL-CPU-2-60GHz/lotsOfClasses.json index 3ef85ab67b..a945b5d3b0 100644 --- a/test/nuts/perfResults/x64-linux-2xIntel-Xeon-Platinum-8272CL-CPU-2-60GHz/lotsOfClasses.json +++ b/test/nuts/perfResults/x64-linux-2xIntel-Xeon-Platinum-8272CL-CPU-2-60GHz/lotsOfClasses.json @@ -1,18 +1,18 @@ [ { "name": "componentSetCreate", - "duration": 398.8911160000134 + "duration": 405.7750340000057 }, { "name": "sourceToMdapi", - "duration": 7309.452422000002 + "duration": 8594.81496599999 }, { "name": "sourceToZip", - "duration": 6389.23871299997 + "duration": 6676.589412000001 }, { "name": "mdapiToSource", - "duration": 4392.979124999954 + "duration": 4316.212134000001 } ] \ No newline at end of file diff --git a/test/nuts/perfResults/x64-linux-2xIntel-Xeon-Platinum-8272CL-CPU-2-60GHz/lotsOfClassesOneDir.json b/test/nuts/perfResults/x64-linux-2xIntel-Xeon-Platinum-8272CL-CPU-2-60GHz/lotsOfClassesOneDir.json index bb4ec6575b..342f5ad320 100644 --- a/test/nuts/perfResults/x64-linux-2xIntel-Xeon-Platinum-8272CL-CPU-2-60GHz/lotsOfClassesOneDir.json +++ b/test/nuts/perfResults/x64-linux-2xIntel-Xeon-Platinum-8272CL-CPU-2-60GHz/lotsOfClassesOneDir.json @@ -1,18 +1,18 @@ [ { "name": "componentSetCreate", - "duration": 705.668066000042 + "duration": 687.1548699999985 }, { "name": "sourceToMdapi", - "duration": 10346.86518199998 + "duration": 11603.490995 }, { "name": "sourceToZip", - "duration": 9459.739873999963 + "duration": 9733.591315000027 }, { "name": "mdapiToSource", - "duration": 7394.224102000007 + "duration": 7484.829251999996 } ] \ No newline at end of file diff --git a/test/nuts/perfResults/x64-linux-2xIntel-Xeon-Platinum-8370C-CPU-2-80GHz/eda.json b/test/nuts/perfResults/x64-linux-2xIntel-Xeon-Platinum-8370C-CPU-2-80GHz/eda.json index 62bbfc65c8..f5bf769341 100644 --- a/test/nuts/perfResults/x64-linux-2xIntel-Xeon-Platinum-8370C-CPU-2-80GHz/eda.json +++ b/test/nuts/perfResults/x64-linux-2xIntel-Xeon-Platinum-8370C-CPU-2-80GHz/eda.json @@ -1,18 +1,18 @@ [ { "name": "componentSetCreate", - "duration": 213.7825759999978 + "duration": 206.5693120000069 }, { "name": "sourceToMdapi", - "duration": 5289.9098340000055 + "duration": 4943.071838999982 }, { "name": "sourceToZip", - "duration": 4398.704352999994 + "duration": 4826.46210199999 }, { "name": "mdapiToSource", - "duration": 3303.2481379999954 + "duration": 3256.713862000004 } ] \ No newline at end of file diff --git a/test/nuts/perfResults/x64-linux-2xIntel-Xeon-Platinum-8370C-CPU-2-80GHz/lotsOfClasses.json b/test/nuts/perfResults/x64-linux-2xIntel-Xeon-Platinum-8370C-CPU-2-80GHz/lotsOfClasses.json index c5f7a4a90a..9710429e94 100644 --- a/test/nuts/perfResults/x64-linux-2xIntel-Xeon-Platinum-8370C-CPU-2-80GHz/lotsOfClasses.json +++ b/test/nuts/perfResults/x64-linux-2xIntel-Xeon-Platinum-8370C-CPU-2-80GHz/lotsOfClasses.json @@ -1,18 +1,18 @@ [ { "name": "componentSetCreate", - "duration": 379.1175959999964 + "duration": 384.5527920000022 }, { "name": "sourceToMdapi", - "duration": 6856.218376000004 + "duration": 6970.504320000007 }, { "name": "sourceToZip", - "duration": 6599.707263999997 + "duration": 6130.4723740000045 }, { "name": "mdapiToSource", - "duration": 3755.471351999993 + "duration": 4920.01653100003 } ] \ No newline at end of file diff --git a/test/nuts/perfResults/x64-linux-2xIntel-Xeon-Platinum-8370C-CPU-2-80GHz/lotsOfClassesOneDir.json b/test/nuts/perfResults/x64-linux-2xIntel-Xeon-Platinum-8370C-CPU-2-80GHz/lotsOfClassesOneDir.json index 22a5c0df1a..2294111997 100644 --- a/test/nuts/perfResults/x64-linux-2xIntel-Xeon-Platinum-8370C-CPU-2-80GHz/lotsOfClassesOneDir.json +++ b/test/nuts/perfResults/x64-linux-2xIntel-Xeon-Platinum-8370C-CPU-2-80GHz/lotsOfClassesOneDir.json @@ -1,18 +1,18 @@ [ { "name": "componentSetCreate", - "duration": 661.3176870000025 + "duration": 681.8188979999977 }, { "name": "sourceToMdapi", - "duration": 10528.364352999983 + "duration": 10472.678083999956 }, { "name": "sourceToZip", - "duration": 9075.544647000002 + "duration": 8984.845709999965 }, { "name": "mdapiToSource", - "duration": 6548.90436700001 + "duration": 10057.14215899998 } ] \ No newline at end of file