Function to build the error message. Here, we can customize the error message format.
The name of the method that failed.
The error message.
The input data that caused the error.
Optional
The inner error that caused the error.
The error message as a string.
Function to build the error message. Here, we can customize the error message format.