Jump to content

Custom Error Management


atrum

Recommended Posts

So, I have been trying to keep track of all my error messages for the login, and register functions.

 

I thought about using a switch statement.

something along the lines of

 

switch(ERROR_MSG)
{case err1:
$error = "some error!";
break;

case err2:
$error = "another error!";
break;

etc etc etc....................................

}
echo $error;

 

 

Somehow that doesn't feel very practical.

 

Can anyone recommend a method for managing my error messages?

 

Thanks,

Link to comment
https://forums.phpfreaks.com/topic/196680-custom-error-management/
Share on other sites

There are a few ways you can do this however how do you want to keep track of these errors? Do they go into a file? multiple files? Please be more specific

 

 

Sorry, I posted that one in a rush.

 

I was thinking of keeping the errors in a separate file, that I could throw into an array, and then use a switch to pull the right error from the array and display it on the default master page.

 

I want to keep my application as "pretty" as I can so that no errors on plain white screens will happen.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.