Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

throw exceptions instead of die() #74

Open
frpuser opened this issue Nov 3, 2022 · 1 comment
Open

throw exceptions instead of die() #74

frpuser opened this issue Nov 3, 2022 · 1 comment

Comments

@frpuser
Copy link

frpuser commented Nov 3, 2022

In the public function Error($msg) in the file tcpdi_parser.php is calling the die() function.
Please replace this die function with an exception throw, so it would be possible to catch the exception in error case.

public function Error($msg) {
        //throw exception instead of die();
        throw new Exception("TCPDI_PARSER ERROR [{$this->uniqueid}]: ".$msg,1);
        // exit program and print error
        //die("<strong>TCPDI_PARSER ERROR [{$this->uniqueid}]: </strong>".$msg);
    }
@frpuser frpuser changed the title throw Exceptions instead of die() throw exceptions instead of die() Nov 3, 2022
@kaystrobach
Copy link
Collaborator

die("<strong>TCPDI_PARSER ERROR [{$this->uniqueid}]: </strong>".$msg);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants