better error messages in selftest
This commit is contained in:
parent
2fc64df38e
commit
a6f53c546e
@ -854,7 +854,7 @@ html, body {
|
||||
}
|
||||
|
||||
.consistency_result {
|
||||
min-width: 400px;
|
||||
width: 500px;
|
||||
color: #222222;
|
||||
border: 1px solid #888;
|
||||
padding: 0 5px;
|
||||
|
2
www/data/css/styles.min.css
vendored
2
www/data/css/styles.min.css
vendored
@ -167,7 +167,7 @@ html,body{margin:0;padding:0;height:100%}
|
||||
.kvl_100 div span:first-child{min-width:100px}
|
||||
.kvl_200 div span:first-child{min-width:200px}
|
||||
.kvl_300 div span:first-child{min-width:300px}
|
||||
.consistency_result{min-width:400px;color:#222;border:1px solid #888;padding:0 5px;margin:1px 0}
|
||||
.consistency_result{width:500px;color:#222;border:1px solid #888;padding:0 5px;margin:1px 0}
|
||||
.consistency_result:after{content:" "}
|
||||
.consistency_result_ok{background:#0f0}
|
||||
.consistency_result_warn{background:#ff0}
|
||||
|
@ -42,7 +42,7 @@
|
||||
.kvl_300 div span:first-child { min-width: 300px; }
|
||||
|
||||
.consistency_result {
|
||||
min-width: 400px;
|
||||
width: 500px;
|
||||
color: $COL_ADMIN_STATUS_FG;
|
||||
border: $COL_ADMIN_STATUS_BORDER;
|
||||
padding: 0 5px;
|
||||
|
@ -190,6 +190,7 @@ class SelfTest implements IWebsiteModule
|
||||
'exception' => null,
|
||||
];
|
||||
|
||||
$url = $_SERVER['HTTP_HOST'] . $path;
|
||||
$r = curl_http_request($_SERVER['HTTP_HOST'] . $path);
|
||||
if ($r['statuscode'] === $status) return
|
||||
[
|
||||
@ -203,7 +204,7 @@ class SelfTest implements IWebsiteModule
|
||||
[
|
||||
'result' => self::STATUS_ERROR,
|
||||
'message' => '{'.$xname.'} failed: Request returned wrong statuscode',
|
||||
'long' => 'Wrong HTTP Statuscode (Expected: ['.$status.']; Found: ['.$r['statuscode'].'])' . "\n" . "Response:\n" . $r['output'] . "\nError [" . $r['errnum'] . "]:\n" . $r['errstr'],
|
||||
'long' => 'Wrong HTTP Statuscode (Expected: ['.$status.']; Found: ['.$r['statuscode'].'])' . "\nURL: $url\n" . "Response:\n" . $r['output'] . "\nError [" . $r['errnum'] . "]:\n" . $r['errstr'],
|
||||
'exception' => null,
|
||||
];
|
||||
}
|
||||
@ -246,7 +247,8 @@ class SelfTest implements IWebsiteModule
|
||||
$count = 0;
|
||||
foreach ($supdata as $d)
|
||||
{
|
||||
$r = curl_http_request($_SERVER['HTTP_HOST'] . str_replace('{0}', $d, $path));
|
||||
$url = $_SERVER['HTTP_HOST'] . str_replace('{0}', $d, $path);
|
||||
$r = curl_http_request($url);
|
||||
$count++;
|
||||
if ($r['statuscode'] === $status) { $message .= "{".$xname."} succeeded" . "\n"; continue; }
|
||||
|
||||
@ -254,7 +256,7 @@ class SelfTest implements IWebsiteModule
|
||||
[
|
||||
'result' => self::STATUS_ERROR,
|
||||
'message' => '{'.$xname.'} failed: Request returned wrong statuscode',
|
||||
'long' => 'Wrong HTTP Statuscode (Expected: ['.$status.']; Found: ['.$r['statuscode'].'])' . "\n" . "Response:\n" . $r['output'] . "\nError [" . $r['errnum'] . "]:\n" . $r['errstr'],
|
||||
'long' => 'Wrong HTTP Statuscode (Expected: ['.$status.']; Found: ['.$r['statuscode'].'])' . "\nURL: $url\n" . "Response:\n" . $r['output'] . "\nError [" . $r['errnum'] . "]:\n" . $r['errstr'],
|
||||
'exception' => null,
|
||||
];
|
||||
}
|
||||
@ -354,14 +356,15 @@ class SelfTest implements IWebsiteModule
|
||||
'exception' => null,
|
||||
];
|
||||
|
||||
$r = curl_http_request($_SERVER['HTTP_HOST'] . $path);
|
||||
$url = $_SERVER['HTTP_HOST'] . $path;
|
||||
$r = curl_http_request($url);
|
||||
if ($r['statuscode'] !== $status)
|
||||
{
|
||||
return
|
||||
[
|
||||
'result' => self::STATUS_ERROR,
|
||||
'message' => '{'.$xname.'} failed: Request returned wrong statuscode',
|
||||
'long' => 'Wrong HTTP Statuscode (Expected: ['.$status.']; Found: ['.$r['statuscode'].'])' . "\n" . "Response:\n" . $r['output'] . "\nError [" . $r['errnum'] . "]:\n" . $r['errstr'],
|
||||
'long' => 'Wrong HTTP Statuscode (Expected: ['.$status.']; Found: ['.$r['statuscode'].'])' . "\nURL: $url\n" . "Response:\n" . $r['output'] . "\nError [" . $r['errnum'] . "]:\n" . $r['errstr'],
|
||||
'exception' => null,
|
||||
];
|
||||
}
|
||||
@ -371,7 +374,7 @@ class SelfTest implements IWebsiteModule
|
||||
[
|
||||
'result' => self::STATUS_ERROR,
|
||||
'message' => '{'.$xname.'} failed: Request returned wrong statuscode',
|
||||
'long' => "Wrong HTTP Response\nExpected:\n$json_expected\nFound:\n".$r['output'] . "\n" . "HTTP Statuscode:\n" . $r['statuscode'] . "\nError [" . $r['errnum'] . "]:\n" . $r['errstr'],
|
||||
'long' => "Wrong HTTP Response\nExpected:\n$json_expected\nFound:\n".$r['output'] . "\nURL: $url\n" . "HTTP Statuscode:\n" . $r['statuscode'] . "\nError [" . $r['errnum'] . "]:\n" . $r['errstr'],
|
||||
'exception' => null,
|
||||
];
|
||||
}
|
||||
@ -551,7 +554,7 @@ class SelfTest implements IWebsiteModule
|
||||
[
|
||||
'result' => self::STATUS_ERROR,
|
||||
'message' => '{'.$xname.'} failed: Request returned wrong statuscode',
|
||||
'long' => 'Wrong HTTP Statuscode (Expected: [200]; Found: ['.$r['statuscode'].'])' . "\n" . "Response:\n" . $r['output'] . "\n" . "Redirect:\n" . $r['redirect'] . "\nError [" . $r['errnum'] . "]:\n" . $r['errstr'],
|
||||
'long' => 'Wrong HTTP Statuscode (Expected: [200]; Found: ['.$r['statuscode'].'])' . "\nURL: $url1 >> $url2\n" . "Response:\n" . $r['output'] . "\n" . "Redirect:\n" . $r['redirect'] . "\nError [" . $r['errnum'] . "]:\n" . $r['errstr'],
|
||||
'exception' => null,
|
||||
];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user