Skip to content

Commit a565d1a

Browse files
committed
log errors
1 parent 5eb989e commit a565d1a

4 files changed

Lines changed: 23 additions & 5 deletions

File tree

solvers/feenox/change_step_solve.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<?php
22

3+
// This file is part of SunCAE.
4+
// SunCAE is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
5+
// SunCAE is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
6+
37
// this is included from change_step.php
48
if (chdir($case_dir) == false) {
59
$response["status"] = "error";
@@ -12,7 +16,7 @@
1216
suncae_log("{$id} problem running");
1317
} else {
1418
$results_meta["status"] = "syntax_error";
15-
suncae_log("{$id} problem syntax error");
19+
suncae_log_error("{$id} problem syntax error");
1620
}
1721

1822

solvers/feenox/results_data/mechanical.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@
33
// SunCAE is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
44
// SunCAE is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
55

6-
// TODO: read & check
76
$displacements_data_path = "../data/{$owner}/cases/{$id}/run/{$problem_hash}-displacements.dat";
87
$sigma_data_path = "../data/{$owner}/cases/{$id}/run/{$problem_hash}-sigma.dat";
98

109
if (file_exists($displacements_data_path) == false) {
11-
$response["error"] = "Displacements data path does not exist";
10+
$response["error"] = "Cannot find results";
1211
suncae_log_error("case {$id} failed \"{$response["error"]}\"");
1312
return_back_json($response);
1413
}
1514
if (file_exists($sigma_data_path) == false) {
16-
$response["error"] = "Stress data path does not exist";
15+
$response["error"] = "Cannot find stresses";
1716
suncae_log_error("case {$id} failed \"{$response["error"]}\"");
1817
return_back_json($response);
1918
}

uxs/faster-than-quick/mesh/gmsh.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
}
1919
}
2020
} else {
21-
echo "error opening {$case_dir}/mesh.geo";
21+
return_error("cannot open {$case_dir}/mesh.geo");
2222
exit();
2323
}
2424

@@ -61,9 +61,13 @@
6161
</div>
6262
<?php
6363
}
64+
suncae_log("problem {$id} mesh ok {$mesh_meta["nodes"]}", 3);
65+
suncae_log("problem {$id} mesh ok " . json_encode($mesh_meta));
66+
6467
} else if ($has_mesh_attempt) {
6568

6669
if ($mesh_meta["status"] == "canceled") {
70+
suncae_log_error("problem {$id} mesh canceled");
6771
?>
6872
<div class="small alert alert-warning">
6973
The meshing process was canceled.
@@ -74,13 +78,16 @@
7478
</button>
7579
<?php
7680
} else if ($mesh_meta["status"] == "syntax_error") {
81+
suncae_log_error("problem {$id} mesh syntax error " . file_get_contents("{$cad_dir}/meshes/{$mesh_hash}-check.2"));
82+
7783
?>
7884
<pre class="small alert alert-danger">
7985
<?=file_get_contents("{$cad_dir}/meshes/{$mesh_hash}-check.2")?>
8086
</pre>
8187

8288
<?php
8389
} else {
90+
suncae_log_error("problem {$id} mesh error " . file_get_contents("{$cad_dir}/meshes/{$mesh_hash}.2"));
8491
?>
8592
<pre class="small alert alert-danger">
8693
<?php
@@ -98,6 +105,7 @@
98105
</pre>
99106
<?php
100107
if (file_exists("{$cad_dir}/meshes/{$mesh_hash}.intersections")) {
108+
suncae_log_error("problem {$id} mesh intersections " . file_get_contents("{$cad_dir}/meshes/{$mesh_hash}.intersections"));
101109
$intersection_translation = trim(file_get_contents("{$cad_dir}/meshes/{$mesh_hash}.intersections"));
102110
if ($intersection_translation != "") {
103111
$intersection_radius = 2*$length_char;
@@ -115,6 +123,7 @@
115123
}
116124
}
117125
} else {
126+
suncae_log_error("problem {$id} no mesh nor attempt");
118127
?>
119128
<div id="error_message" class="small alert alert-dismissible alert-warning">
120129
There is no mesh nor any attempt at it.

uxs/faster-than-quick/results.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
include("results/{$problem}.php");
1616
} else if ($has_results_attempt) {
1717
if ($results_meta["status"] == "canceled") {
18+
suncae_log_error("problem {$id} canceled");
1819
?>
1920
<div class="small alert alert-dismissible alert-warning">
2021
The solving process was canceled.
@@ -26,29 +27,34 @@
2627
</button>
2728
<?php
2829
} else if ($results_meta["status"] == "syntax_error") {
30+
suncae_log_error("problem {$id} syntax error: " . file_get_contents("{$case_dir}/run/{$problem_hash}-check.2"));
2931
?>
3032
<pre class="small alert alert-warning"><?=file_get_contents("{$case_dir}/run/{$problem_hash}-check.2")?></pre>
3133
<?php
3234
} else if ($results_meta["status"] == "error") {
3335
if (file_exists("{$case_dir}/run/{$problem_hash}.2")) {
36+
suncae_log_error("problem {$id} error: " . file_get_contents("{$case_dir}/run/{$problem_hash}-check.2"));
3437
?>
3538
<pre class="small alert alert-danger"><?=file_get_contents("{$case_dir}/run/{$problem_hash}.2")?></pre>
3639
<button class="btn btn-lg btn-outline-success w-100" onclick="relaunch_solving('<?=$problem_hash?>')">
3740
<i class="bi bi-arrow-repeat mx-2"></i>&nbsp;Re-launch solver
3841
</button>
3942
<?php
4043
} else {
44+
suncae_log_error("problem {$id} got status error but not stderr");
4145
?>
4246
Got status error but no stderr.
4347
<?php
4448
}
4549
} else {
50+
suncae_log_error("problem {$id} unknown error");
4651
?>
4752
Not sure what happened.
4853
<?php
4954
}
5055

5156
} else {
57+
suncae_log_error("problem {$id} there are no results nor any attempt at getting them");
5258
?>
5359
<div class="small alert alert-dismissible alert-warning">
5460
There are no results nor any attempt at getting them.

0 commit comments

Comments
 (0)