Skip to content

Commit b142e0d

Browse files
committed
Fix new linter error
1 parent 954ce8c commit b142e0d

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

v-next/core/src/internal/hre.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import type { HardhatPlugin } from "../types/plugins.js";
1414
import type { TaskManager } from "../types/tasks.js";
1515
import type { UserInterruptionManager } from "../types/user-interruptions.js";
1616

17+
import { HardhatError } from "@ignored/hardhat-vnext-errors";
18+
1719
import { ResolvedConfigurationVariableImplementation } from "./configuration-variables.js";
1820
import {
1921
buildGlobalOptionsMap,
@@ -61,14 +63,14 @@ export class HardhatRuntimeEnvironmentImplementation
6163
);
6264

6365
if (userConfigValidationErrors.length > 0) {
64-
throw new Error(
65-
`Invalid config:\n\t${userConfigValidationErrors
66+
throw new HardhatError(HardhatError.ERRORS.GENERAL.INVALID_CONFIG, {
67+
errors: `\t${userConfigValidationErrors
6668
.map(
6769
(error) =>
6870
`* Config error in .${error.path.join(".")}: ${error.message}`,
6971
)
7072
.join("\n\t")}`,
71-
);
73+
});
7274
}
7375

7476
// Resolve config

v-next/hardhat-errors/src/descriptors.ts

+7
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,13 @@ Please add the property "type" with the value "module" in your package.json to e
189189
websiteDescription:
190190
"The global option is already defined by another plugin. Please ensure that global options are uniquely named to avoid conflicts.",
191191
},
192+
INVALID_CONFIG: {
193+
number: 16,
194+
messageTemplate: `Invalid config:
195+
{errors}`,
196+
websiteTitle: "Invalid config",
197+
websiteDescription: `The configuration you provided is invalid. Please check the documentation to learn how to configure Hardhat correctly.`,
198+
},
192199
},
193200
INTERNAL: {
194201
ASSERTION_ERROR: {

0 commit comments

Comments
 (0)