Merge pull request #1199 from morluto/fix/config-error-names-setting
fix(config): name the rejected setting and its constraint in configuration errors
This commit is contained in:
@@ -18,7 +18,10 @@ import {
|
||||
AnalysisResourceConstraintError,
|
||||
} from "./analysisErrorCore.js";
|
||||
import { ArtifactOperationError } from "./artifactOperationError.js";
|
||||
import { BinaryTargetError } from "./configurationErrors.js";
|
||||
import {
|
||||
BinaryTargetError,
|
||||
ConfigurationError,
|
||||
} from "./configurationErrors.js";
|
||||
import { BrowserObservationError } from "./browserObservationError.js";
|
||||
import {
|
||||
EvidenceFileError,
|
||||
@@ -487,6 +490,13 @@ const lifecycleErrorDetails = (
|
||||
};
|
||||
return Object.keys(details).length === 0 ? undefined : details;
|
||||
}
|
||||
if (error instanceof ConfigurationError && error.settings.length > 0)
|
||||
return {
|
||||
settings: error.settings.map(({ setting, constraint }) => ({
|
||||
setting,
|
||||
constraint,
|
||||
})),
|
||||
};
|
||||
if (error instanceof BinaryTargetError)
|
||||
return {
|
||||
path: error.path,
|
||||
|
||||
Reference in New Issue
Block a user