Identical error messages for different validation checks leads to reduced debugging clarity
Two distinct preconditions in _removeFromClaimQueue revert with the same Invalid Claim request message, making it hard to tell which check failed without inspecting the trace.
Description
In the _removeFromClaimQueue function of the GenesisLicenseStaking contract, two different validation checks use the exact same error message:
require($._claimQueueIds.contains(index_), "Invalid Claim request");require(!$._fulfilledClaimIds.contains(index_), "Invalid Claim request");
These checks validate different conditions:
- The first check verifies that the claim exists in the active queue.
- The second check verifies that the claim has not already been fulfilled.
Using identical error messages for different failure conditions makes it difficult to diagnose issues during development, testing, and production. When a transaction reverts with "Invalid Claim request", it's impossible to determine which specific validation failed without examining the transaction trace or debugging the code.
Recommendation
Use distinct, descriptive error messages for each validation check to improve debugging and error handling:
require($._claimQueueIds.contains(index_), "Claim not found in active queue");require(!$._fulfilledClaimIds.contains(index_), "Claim already fulfilled");

