Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Error Reason #5677

@verma-shu6ham

Description

@verma-shu6ham

What's up?

Hi, in the function given below I am reverting with the message "Insufficient Balance." in React error object I am not getting error reason but on other hand in the ganache console error reason is showing, how will I get reason in react.

Examples/References

   function registerJob(
       string memory _jobName,
       string memory _jobDescription,
      uint256 _jobBudget
   ) external payable {
        require(extraFund() + msg.value >= _jobBudget, "Insufficient Balance.");
             uint32 timeNow = uint32(block.timestamp);
             _jobIds++;
             Job storage _job = _jobs[_jobIds];
             _job.jobId = _jobIds;
             _job.jobName = _jobName;
             _job.jobDescription = _jobDescription;
             _job.jobOwner = payable(msg.sender);
             _job.jobWorker = payable(0x0);
             _job.isCompleted = false;
             _job.isJobValid = true;
             _job.jobRegisteredDate = timeNow;
             _job.jobStartedDate = 0;
             _job.jobCompletedDate = 0;
             _job.jobBudget = _jobBudget;
             _job.jobSettledAmount = 0;
             _liveJobs.add(_jobIds);
             _fundByJobOwner[msg.sender] += msg.value;
             _jobOwnerFundLocked[msg.sender] += _jobBudget;
             emit JobRegistered(msg.sender, _jobBudget, _jobName, _jobIds);
}

}

image
image

Metadata

Metadata

Labels

1.x1.0 related issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions