HCE Project DC service web UI
0.2
Hierarchical Cluster Engine DC service web UI
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
HCE Project DC service web UI
Bootstrap Colorpicker 2.0
Overview
CKEditor 4 Changelog
Software License Agreement
ChangeLog
Installing instructions
widgets
yii2-debug
Todo List
Deprecated List
Namespaces
Classes
Files
File List
app
protected
commands
components
config
controllers
extensions
helpers
Dictionary.php
Errors.php
GRI.php
Logger.php
models
modules
runtime
tests
vendor
views
yiic.php
themes
index.php
File Members
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Pages
Errors.php
Go to the documentation of this file.
1
<?php
2
class
Errors
{
3
public
static
function
isError
($jsonRaw) {
4
$json
= CJSON::decode($jsonRaw);
5
if
(is_null(
$json
)) {
6
throw
new
CHttpException(
'DCC'
,
"Can't access DC Client. Please, check the \"PathToApi\" string in config.ini"
);
7
}
8
if
(isset(
$json
[
'errorCode'
])) {
9
$nodes = explode(
';'
,
$json
[
'errorCode'
]);
10
foreach
($nodes as $k => $v) {
11
if
(($v != 0) || ($v != 0)) {
12
return
$json
[
'errorMessage'
];
13
}
14
}
15
}
16
if
(isset(
$json
[
'error_code'
])) {
17
$nodes = explode(
';'
,
$json
[
'error_code'
]);
18
foreach
($nodes as $k => $v) {
19
if
(($v != 0) || ($v != 0)) {
20
return
$json
[
'error_message'
];
21
}
22
}
23
}
24
if
((isset(
$json
[
'itemsList'
][0][
'errorCode'
])) && (
$json
[
'itemsList'
][0][
'errorCode'
] != 0)) {
25
return
$json
[
'itemsList'
][0][
'errorMessage'
];
26
} elseif ((isset(
$json
[
'itemsList'
][0][
'itemObject'
][
'errorCode'
])) && (
$json
[
'itemsList'
][0][
'itemObject'
][
'errorCode'
] != 0)) {
27
return
$json
[
'itemsList'
][0][
'itemObject'
][
'errorMessage'
];
28
}
29
return
0;
30
}
31
}
app
protected
helpers
Errors.php
Generated on Tue Jun 30 2015 20:12:34 for HCE Project DC service web UI by
1.8.1.2