Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: stop capturing initialize errors #474

Merged
merged 3 commits into from
May 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion server/src/frameworks/Ape/ApeProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export class ApeProject extends Project {
}
} catch (error) {
this.initializeError = `${error}`;
this.serverState.logger.error(this.initializeError);
this.serverState.logger.info(this.initializeError);
}

return;
Expand Down
3 changes: 1 addition & 2 deletions server/src/frameworks/Foundry/FoundryProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ export class FoundryProject extends Project {
);
this.remappings = parseRemappings(rawRemappings);
} catch (error: any) {
this.serverState.logger.error(error.toString());

switch (error.code) {
case 134:
this.initializeError =
Expand All @@ -79,6 +77,7 @@ export class FoundryProject extends Project {
default:
this.initializeError = `Unexpected error while running \`forge\`: ${error}`;
}
this.serverState.logger.info(this.initializeError);
}

return;
Expand Down
6 changes: 4 additions & 2 deletions server/src/frameworks/Truffle/TruffleProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class TruffleProject extends Project {
const errorMessage = `Truffle module not found. Ensure it's installed globally or locally.`;
this.status = Status.INITIALIZED_FAILURE;
this.initializeError = errorMessage;
throw new Error(errorMessage);
this.serverState.logger.info(this.initializeError);
}

try {
Expand All @@ -90,11 +90,13 @@ export class TruffleProject extends Project {
this.serverState.solcVersions,
configSolcVersion
);

if (resolvedSolcVersion === null) {
throw new Error(
`No version satisfies ${configSolcVersion}. Available versions are: ${this.serverState.solcVersions}`
);
}

this.resolvedSolcVersion = resolvedSolcVersion;

// Load contracts directory
Expand All @@ -113,7 +115,7 @@ export class TruffleProject extends Project {
const errorMessage = `Error loading config file ${this.configPath}: ${error}`;
this.status = Status.INITIALIZED_FAILURE;
this.initializeError = errorMessage;
throw new Error(errorMessage);
this.serverState.logger.info(this.initializeError);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export async function indexWorkspaceFolders(
try {
await foundProject.initialize();
} catch (error) {
logger.error(`Error initializing ${foundProject.basePath}: ${error}`);
kanej marked this conversation as resolved.
Show resolved Hide resolved
logger.error(error);
}

span?.finish();
Expand Down