Skip to content

Commit

Permalink
rethrow if other error
Browse files Browse the repository at this point in the history
  • Loading branch information
frangio committed Mar 28, 2024
1 parent e38c3b3 commit a67f47d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/core.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path';

import { findAll, astDereferencer, ASTDereferencer } from 'solidity-ast/utils';
import { findAll, astDereferencer, ASTDereferencer, ASTDereferencerError } from 'solidity-ast/utils';
import { formatLines, Lines, spaceBetween } from './utils/format-lines';
import type { Visibility, SourceUnit, ContractDefinition, FunctionDefinition, VariableDeclaration, StorageLocation, TypeDescriptions, TypeName, InheritanceSpecifier, ModifierInvocation, FunctionCall } from 'solidity-ast';
import type { FileContent, ProjectPathsConfig, ResolvedFile } from 'hardhat/types';
Expand Down Expand Up @@ -522,9 +522,13 @@ function getUdvtType(typeName: TypeName, context: ContractDefinition, deref: AST
if (typeName.nodeType === 'UserDefinedTypeName') {
return deref('UserDefinedValueTypeDefinition', typeName.referencedDeclaration).underlyingType.typeDescriptions.typeString ?? undefined;
}
} catch { /* passthrough */ }

return undefined;
} catch (err: unknown) {
if (err instanceof ASTDereferencerError) {
return undefined;
} else {
throw err;
}
}
}

function getVariables(contract: ContractDefinition, deref: ASTDereferencer, subset?: Visibility[]): VariableDeclaration[] {
Expand Down

0 comments on commit a67f47d

Please sign in to comment.