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

Coding erros in upload\catalog\controller\extension\wallee\cron.php - OpenCart error log filled with messages #6

Open
dupuisv opened this issue Oct 24, 2024 · 2 comments

Comments

@dupuisv
Copy link

dupuisv commented Oct 24, 2024

	catch (Exception $e) {
		// 1062 is mysql duplicate constraint error. This is expected and doesn't need to be logged.
		if (strpos('1062', $e->getMessage()) === false && strpos('constraint_key', $e->getMessage()) === false) {
			\WalleeHelper::instance($this->registry)->log('Updating cron failed: ' . $e->getMessage(), \WalleeHelper::LOG_ERROR);
		}
		\WalleeHelper::instance($this->registry)->dbTransactionRollback();
		die();
  1. is not a correct usage of strpos
  2. constraint_key is always present in $e->getMessage() when exception occurs

that is one way to correct the statement
catch (Exception $e) {
// 1062 is mysql duplicate constraint error. This is expected and doesn't need to be logged.
if (!(strpos($e->getMessage(),'1062')>=0 && strpos($e->getMessage(),'for key \’constraint_key'')>=0)) {
\WalleeHelper::instance($this->registry)->log('Updating cron failed: ' . $e->getMessage(), \WalleeHelper::LOG_ERROR);
}
\WalleeHelper::instance($this->registry)->dbTransactionRollback(); // on ignore
die();

Reginald

@dupuisv
Copy link
Author

dupuisv commented Oct 24, 2024

		// 1062 is mysql duplicate constraint error. This is expected and doesn't need to be logged.
		if (!(strpos($e->getMessage(),'1062')>=0 && strpos($e->getMessage(),'for key \’constraint_key\'')>=0)) {
			\WalleeHelper::instance($this->registry)->log('Updating cron failed: ' . $e->getMessage(), \WalleeHelper::LOG_ERROR);
		}
		\WalleeHelper::instance($this->registry)->dbTransactionRollback();  // on ignore
		die();

@leanderpfleghard
Copy link

Hello @dupuisv,

Thank you for your message and for bringing this to our attention. In order to investigate this issue further, we would need more details about your Wallee account and the specific configuration you’re using.

Could you please send an email to [email protected] with your account details and include my name in the message? I’ll make sure to review the situation personally and get back to you as soon as possible.

Thank you for your cooperation, and we look forward to resolving this issue for you.

Best regards,
Leander from Wallee

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