Skip to content

Commit d13d51c

Browse files
benflexcomputeflow360-auto-hotfix-bot
authored andcommitted
Raise on error by default (#1351)
* Added Python version for user agent * Fix lint * Raise on error by default * Changed the default to raise on error submission to avoid user confusion * Better error message
1 parent 64d3f9b commit d13d51c

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

flow360/component/project.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,7 +1363,7 @@ def _run(
13631363
use_geometry_AI : bool, optional
13641364
Whether to use the Geometry AI (default is False).
13651365
raise_on_error: bool, optional
1366-
Option to raise if submission error occurs (default is False)
1366+
Option to raise if submission error occurs
13671367
tags: List[str], optional
13681368
A list of tags to add to the target asset.
13691369
draft_only: bool, optional
@@ -1408,10 +1408,10 @@ def _run(
14081408

14091409
if errors is not None:
14101410
log.error(
1411-
f"Validation error found in the simulation params: {formatting_validation_errors(errors=errors)}"
1411+
f"Validation error found during local validation: {formatting_validation_errors(errors=errors)}"
14121412
)
14131413
if raise_on_error:
1414-
raise ValueError("Submission terminated due to validation error.")
1414+
raise ValueError("Submission terminated due to local validation error.")
14151415
return None
14161416

14171417
source_item_type = self.metadata.root_item_type.value if fork_from is None else "Case"
@@ -1496,7 +1496,7 @@ def generate_surface_mesh(
14961496
solver_version: str = None,
14971497
use_beta_mesher: bool = None,
14981498
use_geometry_AI: bool = False, # pylint: disable=invalid-name
1499-
raise_on_error: bool = False,
1499+
raise_on_error: bool = True,
15001500
tags: List[str] = None,
15011501
draft_only: bool = False,
15021502
**kwargs,
@@ -1519,7 +1519,7 @@ def generate_surface_mesh(
15191519
use_geometry_AI : bool, optional
15201520
Whether to use the Geometry AI (default is False).
15211521
raise_on_error: bool, optional
1522-
Option to raise if submission error occurs (default is False)
1522+
Option to raise if submission error occurs (default is True)
15231523
tags: List[str], optional
15241524
A list of tags to add to the generated surface mesh.
15251525
draft_only: bool, optional
@@ -1566,7 +1566,7 @@ def generate_volume_mesh(
15661566
solver_version: str = None,
15671567
use_beta_mesher: bool = None,
15681568
use_geometry_AI: bool = False, # pylint: disable=invalid-name
1569-
raise_on_error: bool = False,
1569+
raise_on_error: bool = True,
15701570
tags: List[str] = None,
15711571
draft_only: bool = False,
15721572
**kwargs,
@@ -1589,7 +1589,7 @@ def generate_volume_mesh(
15891589
use_geometry_AI : bool, optional
15901590
Whether to use the Geometry AI (default is False).
15911591
raise_on_error: bool, optional
1592-
Option to raise if submission error occurs (default is False)
1592+
Option to raise if submission error occurs (default is True)
15931593
tags: List[str], optional
15941594
A list of tags to add to the generated volume mesh.
15951595
draft_only: bool, optional
@@ -1645,7 +1645,7 @@ def run_case(
16451645
solver_version: str = None,
16461646
use_beta_mesher: bool = None,
16471647
use_geometry_AI: bool = False, # pylint: disable=invalid-name
1648-
raise_on_error: bool = False,
1648+
raise_on_error: bool = True,
16491649
tags: List[str] = None,
16501650
draft_only: bool = False,
16511651
**kwargs,
@@ -1672,7 +1672,7 @@ def run_case(
16721672
use_geometry_AI : bool, optional
16731673
Whether to use the Geometry AI (default is False).
16741674
raise_on_error: bool, optional
1675-
Option to raise if submission error occurs (default is False)
1675+
Option to raise if submission error occurs (default is True)
16761676
tags: List[str], optional
16771677
A list of tags to add to the case.
16781678
draft_only: bool, optional

flow360/component/simulation/web/draft.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def run_up_to_target_asset(
185185
return destination_id
186186
except Flow360WebError as err:
187187
# Error found when translating/running the simulation
188-
log.error(">>Submission failed.<<")
188+
log.error(">>Submission to cloud failed.<<")
189189
try:
190190
detailed_error = json.loads(err.auxiliary_json["detail"])["detail"]
191191
log.error(

0 commit comments

Comments
 (0)