1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
learnexception.php
См. документацию.
1<?php
2
3class LearnException extends Exception
4{
5 const EXC_ERR_ALL_LOGIC = 0x0000100; // Logic error
6 const EXC_ERR_ALL_GIVEUP = 0x0001000; // Any fatal error, on which called method gives up
7 const EXC_ERR_ALL_PARAMS = 0x0002000; // At least one of params is out of admitted range
8 const EXC_ERR_ALL_ACCESS_DENIED = 0x0010000; // Access denied during some operation
9 const EXC_ERR_ALL_NOT_EXISTS = 0x0020000; // Item not exists
10
11 // Graph relations
12 const EXC_ERR_GR_LINK = 0x0000001; // GraphRelation error: unable to link edge
13 const EXC_ERR_GR_UNLINK = 0x0000002; // GraphRelation error: unable to unlink edge
14 const EXC_ERR_GR_SET_PROPERTY = 0x0000004; // GraphRelation error: unable to set property
15 const EXC_ERR_GR_GET_PROPERTY = 0x0000008; // GraphRelation error: unable to get property value
16 const EXC_ERR_GR_GET_NEIGHBOURS = 0x0000800; // GraphRelation error: unable to list neighbours
17 const EXC_ERR_GR_UPDATE = 0x0004000; // GraphRelation error: unable to update link parametres
18
19 // Graph nodes
20 const EXC_ERR_GN_CREATE = 0x0000010; // GraphNode error: unable to create graph node
21 const EXC_ERR_GN_UPDATE = 0x0000080; // GraphNode error: unable to update graph node
22 const EXC_ERR_GN_REMOVE = 0x0000200; // GraphNode error: unable to remove graph node
23 const EXC_ERR_GN_GETBYID = 0x0000400; // GraphNode error: unable to get graph node by id
24 const EXC_ERR_GN_CHECK_PARAMS = 0x0000020; // GraphNode error: failed when params checked
25 const EXC_ERR_GN_FILE_UPLOAD = 0x0000040; // GraphNode error: file uploading failure
26
27 // CLearnPath
28 const EXC_ERR_LP_BROKEN_PATH = 0x0008000; // broken path
29
30 // CLearnLesson
31 const EXC_ERR_LL_UNREMOVABLE_CL = 0x0040000; // lesson is unremovable, because linked course is unremovable
32 // nextID = 0x0080000
33
34 // Redefine the exception to log exceptions
35 public function __construct($message = null, $code = 0)
36 {
37 //$trace = debug_backtrace();
38 // $trace = $this->trace;
39 //$this->learning_log_exception ($message, $code, $this->line, $this->file, $trace);
40
41 // make sure everything is assigned properly
42 parent::__construct($message, $code);
43 }
44
45 protected function learning_log_exception ($message, $code, $line, $file, $backtrace)
46 {
47 if ( ! method_exists('CDatabase', 'Query') )
48 return;
49
50 global $DB;
51
52 if ( ! (is_object($DB) && method_exists($DB, 'Query')) )
53 return;
54
55 if ( ! $DB->TableExists('b_learn_exceptions_log') )
56 return;
57
58 $DB->Query (
59 "INSERT INTO b_learn_exceptions_log
60 (DATE_REGISTERED, CODE, MESSAGE, FFILE, LINE, BACKTRACE)
61 VALUES (" . $DB->GetNowFunction() . ", " . (int) $code . ", '"
62 . $DB->ForSQL($message) . "', '" . $DB->ForSQL($file) . "', "
63 . (int) $line . ",'"
64 . $DB->ForSQL(base64_encode(serialize($backtrace))) // due to charsets problems do base64_encode()
65 . "')
66 ",
67 true);
68 }
69}
Определения learnexception.php:4
const EXC_ERR_ALL_PARAMS
Определения learnexception.php:7
const EXC_ERR_GR_SET_PROPERTY
Определения learnexception.php:14
const EXC_ERR_LP_BROKEN_PATH
Определения learnexception.php:28
const EXC_ERR_GN_FILE_UPLOAD
Определения learnexception.php:25
const EXC_ERR_GN_GETBYID
Определения learnexception.php:23
const EXC_ERR_GN_REMOVE
Определения learnexception.php:22
const EXC_ERR_GR_GET_NEIGHBOURS
Определения learnexception.php:16
learning_log_exception($message, $code, $line, $file, $backtrace)
Определения learnexception.php:45
const EXC_ERR_GR_UNLINK
Определения learnexception.php:13
const EXC_ERR_ALL_ACCESS_DENIED
Определения learnexception.php:8
const EXC_ERR_ALL_NOT_EXISTS
Определения learnexception.php:9
const EXC_ERR_ALL_LOGIC
Определения learnexception.php:5
const EXC_ERR_GN_UPDATE
Определения learnexception.php:21
__construct($message=null, $code=0)
Определения learnexception.php:35
const EXC_ERR_GR_UPDATE
Определения learnexception.php:17
const EXC_ERR_GR_LINK
Определения learnexception.php:12
const EXC_ERR_ALL_GIVEUP
Определения learnexception.php:6
const EXC_ERR_GN_CREATE
Определения learnexception.php:20
const EXC_ERR_GN_CHECK_PARAMS
Определения learnexception.php:24
const EXC_ERR_LL_UNREMOVABLE_CL
Определения learnexception.php:31
const EXC_ERR_GR_GET_PROPERTY
Определения learnexception.php:15
global $DB
Определения cron_frame.php:29
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
Определения options.php:195
$message
Определения payment.php:8