diff --git a/mirzaev/baza/system/database.php b/mirzaev/baza/system/database.php index 94e3290..9b3ed99 100755 --- a/mirzaev/baza/system/database.php +++ b/mirzaev/baza/system/database.php @@ -463,9 +463,11 @@ class database } else { // The record contains only empty values } - } catch (exception_logic | exception_invalid_argument $exception) { + } catch (exception_logic | exception_invalid_argument | exception_domain $exception) { // Writing into the buffer of failed to reading records - /* $failed[] = $record; */ + + // Exit (fail) + throw new exception_runtime('Failed to processing the record', previous: $exception); } } diff --git a/mirzaev/baza/system/record.php b/mirzaev/baza/system/record.php index 5ab6f9a..20c5a97 100755 --- a/mirzaev/baza/system/record.php +++ b/mirzaev/baza/system/record.php @@ -4,6 +4,9 @@ declare(strict_types=1); namespace mirzaev\baza; +// Built-in libraries +use DomainException as exception_domain; + /** * Record * @@ -63,12 +66,23 @@ class record * @param string $name Name of the parameter * @param mixed $value Content of the parameter * + * @throws exception_domain if not found the parameter + * * @return void */ public function __set(string $name, mixed $value = null): void { - // Writing the value and exit - $this->values[$name] = $value; + if (isset($this->values[$name])) { + // Initialized the parameter + + // Writing the value and exit + $this->values[$name] = $value; + } else { + // Not initialized the parameter + + // Exit (fail) + throw new exception_domain("Not found the parameter: $name"); + } } /**