More details:
1st hash: hash of error messages
2nd hash: error message itself (error_name)
which contains 3 key values (statusCode, message, params)
I am trying to create a method that will take in error_name and print out the message. This is the code I have at the minute:
`our %error = (
ERROR_1 => {
statusCode => 561.
message => "an unexpected error occurred at location X",
params => $param_1,
}
ERROR_2 => {
statusCode => 561.
message => "an unexpected error occurred at location Y",
params => $param_1,
}
);
`
Is this possible? I'm trying to create a subroutine that will take an error from the hash %error and print out its message. Is this possible? Or maybe there is a better way of doing it.