1: <?php
2: /**
3: * This file contains the implementation of the class DBWorkerException. It extends the DBWorkerException
4: * exception to distinguish the database related errors in catches.
5: *
6: * @package Database
7: *
8: * @author Oleg Schildt
9: */
10:
11: namespace SmartFactory\DatabaseWorkers;
12:
13: use \SmartFactory\SmartException;
14:
15: /**
16: * Class for DBWorkerException in the SmartFactory library.
17: *
18: * @author Oleg Schildt
19: */
20: class DBWorkerException extends SmartException
21: {
22: /**
23: * Constructor.
24: *
25: * @param string $message
26: * Error message.
27: *
28: * @param string $error_code
29: * Error code.
30: *
31: * Since the error texts can be localized, the unique code of the error might be important fo using
32: * in comparison.
33: *
34: * @param string $error_element
35: * Error element.
36: *
37: * @param array $error_details
38: * The details might be useful if the message translations are provided on the client, not
39: * on the server, and the message should contain some details that may vary from case to case.
40: * In that case, the servers return the message id instead of final text and the details, the client
41: * uses the message id, gets the final translated text and substitutes the parameters through the details.
42: *
43: * @param string $technical_info
44: * Additional technical information. It can be used if it is a programming error and displayed only if the debug mode is active.
45: *
46: * @author Oleg Schildt
47: */
48: public function __construct(string $message, string $error_code, string $error_element = "", array $error_details = [], string $technical_info = "")
49: {
50: parent::__construct($message, $error_code, $error_element, $error_details, $technical_info);
51: }
52: } // DBWorkerException