From 2ff1b296a103c8fa082836710f4f3f7623a67a00 Mon Sep 17 00:00:00 2001 From: Josselin Date: Tue, 30 Jul 2019 11:16:54 +0200 Subject: [PATCH] Minor --- slither/solc_parsing/slitherSolc.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/slither/solc_parsing/slitherSolc.py b/slither/solc_parsing/slitherSolc.py index e6ac1c932..70e276f19 100644 --- a/slither/solc_parsing/slitherSolc.py +++ b/slither/solc_parsing/slitherSolc.py @@ -224,11 +224,11 @@ class SlitherSolc(Slither): else: father_constructors.append(self._contracts_by_id[i]) - except KeyError: - txt = 'A contract was not found, it is likely that your codebase contains muliple contracts with the same name' - txt += 'Truffle does not handle this case during compilation' - txt += 'Please read https://github.com/trailofbits/slither/wiki#keyerror-or-nonetype-error' - txt += 'And update your code to remove the duplicate' + except KeyError as e: + txt = f'A contract was not found (id {e}), it is likely that your codebase contains muliple contracts with the same name. ' + txt += 'Truffle does not handle this case during compilation. ' + txt += 'Please read https://github.com/trailofbits/slither/wiki#keyerror-or-nonetype-error, ' + txt += 'and update your code to remove the duplicate' raise ParsingContractNotFound(txt) contract.setInheritance(ancestors, fathers, father_constructors)