Skip to content

Commit

Permalink
feat(Commands): log exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
cooldogedev committed Nov 8, 2023
1 parent abeabb4 commit f523b9e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/cooldogedev/BedrockEconomy/command/BalanceCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,9 @@ function () use ($sender, $player, $isSelf): Generator {
]));
} catch (RecordNotFoundException) {
$sender->sendMessage(LanguageManager::getString(KnownMessages::ERROR_ACCOUNT_NONEXISTENT));
} catch (SQLException) {
} catch (SQLException $exception) {
$sender->sendMessage(LanguageManager::getString(KnownMessages::ERROR_DATABASE));
$this->getOwningPlugin()->getLogger()->logException($exception);
}
}
);
Expand Down
3 changes: 2 additions & 1 deletion src/cooldogedev/BedrockEconomy/command/PayCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,9 @@ function () use ($sender, $player, $balance, $decimals): Generator {
$sender->sendMessage(LanguageManager::getString(KnownMessages::ERROR_ACCOUNT_NONEXISTENT));
} catch (InsufficientFundsException) {
$sender->sendMessage(LanguageManager::getString(KnownMessages::ERROR_ACCOUNT_INSUFFICIENT));
} catch (SQLException) {
} catch (SQLException $exception) {
$sender->sendMessage(LanguageManager::getString(KnownMessages::ERROR_DATABASE));
$this->getOwningPlugin()->getLogger()->logException($exception);
}
}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,9 @@ function () use ($sender, $player, $balance, $decimals): Generator {
]));
} catch (RecordNotFoundException) {
$sender->sendMessage(LanguageManager::getString(KnownMessages::ERROR_ACCOUNT_NONEXISTENT));
} catch (SQLException) {
} catch (SQLException $exception) {
$sender->sendMessage(LanguageManager::getString(KnownMessages::ERROR_DATABASE));
$this->getOwningPlugin()->getLogger()->logException($exception);
}
}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,9 @@ function () use ($sender, $player, $balance, $decimals): Generator {
$sender->sendMessage(LanguageManager::getString(KnownMessages::ERROR_ACCOUNT_NONEXISTENT));
} catch (InsufficientFundsException) {
$sender->sendMessage(LanguageManager::getString(KnownMessages::ERROR_ACCOUNT_INSUFFICIENT));
} catch (SQLException) {
} catch (SQLException $exception) {
$sender->sendMessage(LanguageManager::getString(KnownMessages::ERROR_DATABASE));
$this->getOwningPlugin()->getLogger()->logException($exception);
}
}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,9 @@ function () use ($sender, $player, $balance, $decimals): Generator {
]));
} catch (RecordNotFoundException) {
$sender->sendMessage(LanguageManager::getString(KnownMessages::ERROR_ACCOUNT_NONEXISTENT));
} catch (SQLException) {
} catch (SQLException $exception) {
$sender->sendMessage(LanguageManager::getString(KnownMessages::ERROR_DATABASE));
$this->getOwningPlugin()->getLogger()->logException($exception);
}
}
);
Expand Down

0 comments on commit f523b9e

Please sign in to comment.