Two modifiers on a contract throw an "Exception during execution. (invalid opcode)." error when not being satisfied as expected. Both of them are calling an event when the condition they check is not met. So I guess the exception comes from calling the event on the modifier. Is that correct?
The event log is this one:
event Error(string error);
And the modifiers are the following:
modifier onlyOwner() {
if (msg.sender != owner) {
Error('Mortal: onlyOwner function called by user that is not owner'); throw;
}
_;
}
modifier onlyIssuer() {
if (!issuers[phoneNumbers[msg.sender]]) {
Error('Mobile: onlyIssuer function called by user that is not an authorized issuer'); throw;
}
_;
}
The full source code of the contract is available at https://gist.github.com/computerphysicslab/f362383f9d3fed26becba48b934bbcfc
So, if modifiers cannot call events, is not possible to log somehow a function that fails because its modifiers weren't met?
Thanks!