This repository was archived by the owner on Oct 19, 2024. It is now read-only.
File tree 2 files changed +21
-1
lines changed
2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,13 @@ pub enum SolcError {
32
32
Resolve ( SolcIoError ) ,
33
33
#[ error( "File could not be resolved due to broken symlink: {0}." ) ]
34
34
ResolveBadSymlink ( SolcIoError ) ,
35
+ #[ error(
36
+ r#"Failed to resolve file: {0}.
37
+ --> {1:?}
38
+ {2:?}
39
+ Check configured remappings."#
40
+ ) ]
41
+ FailedResolveImport ( SolcIoError , PathBuf , PathBuf ) ,
35
42
#[ cfg( feature = "svm-solc" ) ]
36
43
#[ error( transparent) ]
37
44
SvmError ( #[ from] svm:: SolcVmError ) ,
Original file line number Diff line number Diff line change @@ -368,7 +368,20 @@ impl Graph {
368
368
& mut resolved_solc_include_paths,
369
369
) {
370
370
Ok ( import) => {
371
- add_node ( & mut unresolved, & mut index, & mut resolved_imports, import) ?;
371
+ add_node ( & mut unresolved, & mut index, & mut resolved_imports, import)
372
+ . map_err ( |err| {
373
+ match err {
374
+ SolcError :: Resolve ( err) => {
375
+ // make the error more verbose
376
+ SolcError :: FailedResolveImport (
377
+ err,
378
+ node. path . clone ( ) ,
379
+ import_path. clone ( ) ,
380
+ )
381
+ }
382
+ _ => err,
383
+ }
384
+ } ) ?
372
385
}
373
386
Err ( err) => {
374
387
unresolved_imports. insert ( ( import_path. to_path_buf ( ) , node. path . clone ( ) ) ) ;
You can’t perform that action at this time.
0 commit comments