mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Change the error message of empty callback/error in libsolc
This commit is contained in:
parent
576954c19b
commit
44c1f4a3bf
@ -53,7 +53,7 @@ ReadCallback::Callback wrapReadCallback(CStyleReadFileCallback _readCallback = n
|
||||
if (!contents_c && !error_c)
|
||||
{
|
||||
result.success = false;
|
||||
result.responseOrErrorMessage = "File not found.";
|
||||
result.responseOrErrorMessage = "Callback not supported.";
|
||||
}
|
||||
if (contents_c)
|
||||
{
|
||||
|
@ -40,6 +40,8 @@ extern "C" {
|
||||
/// @param o_contents A pointer to the contents of the file, if found.
|
||||
/// @param o_error A pointer to an error message, if there is one.
|
||||
///
|
||||
/// If the callback is not supported, o_contents and o_error should be set to NULL.
|
||||
///
|
||||
/// The two pointers (o_contents and o_error) should be heap-allocated and are free'd by the caller.
|
||||
typedef void (*CStyleReadFileCallback)(char const* _path, char** o_contents, char** o_error);
|
||||
|
||||
|
@ -167,7 +167,7 @@ BOOST_AUTO_TEST_CASE(with_callback)
|
||||
BOOST_CHECK(containsError(result, "ParserError", "Source \"missing.sol\" not found: Missing file."));
|
||||
|
||||
// This should be placed due to the missing "notfound.sol" which sets both pointers to null.
|
||||
BOOST_CHECK(containsError(result, "ParserError", "Source \"notfound.sol\" not found: File not found."));
|
||||
BOOST_CHECK(containsError(result, "ParserError", "Source \"notfound.sol\" not found: Callback not supported."));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
Loading…
Reference in New Issue
Block a user