Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Romin Tomasetti
gmsh
Commits
d74fe01b
Commit
d74fe01b
authored
4 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
when General.AbortOnError == 2, throw the last error message, instead of 1 (see #1043)
parent
ec15fd1d
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Common/GmshMessage.cpp
+23
-24
23 additions, 24 deletions
Common/GmshMessage.cpp
with
23 additions
and
24 deletions
Common/GmshMessage.cpp
+
23
−
24
View file @
d74fe01b
...
@@ -507,8 +507,6 @@ void Msg::Error(const char *fmt, ...)
...
@@ -507,8 +507,6 @@ void Msg::Error(const char *fmt, ...)
_errorCount
++
;
_errorCount
++
;
_atLeastOneErrorInRun
=
1
;
_atLeastOneErrorInRun
=
1
;
if
(
GetVerbosity
()
<
1
)
return
;
char
str
[
5000
];
char
str
[
5000
];
va_list
args
;
va_list
args
;
va_start
(
args
,
fmt
);
va_start
(
args
,
fmt
);
...
@@ -516,12 +514,13 @@ void Msg::Error(const char *fmt, ...)
...
@@ -516,12 +514,13 @@ void Msg::Error(const char *fmt, ...)
va_end
(
args
);
va_end
(
args
);
int
l
=
strlen
(
str
);
if
(
str
[
l
-
1
]
==
'\n'
)
str
[
l
-
1
]
=
'\0'
;
int
l
=
strlen
(
str
);
if
(
str
[
l
-
1
]
==
'\n'
)
str
[
l
-
1
]
=
'\0'
;
if
(
_logFile
)
fprintf
(
_logFile
,
"Error: %s
\n
"
,
str
);
if
(
_callback
)
(
*
_callback
)(
"Error"
,
str
);
if
(
_client
)
_client
->
Error
(
str
);
if
(
_firstError
.
empty
())
_firstError
=
str
;
if
(
_firstError
.
empty
())
_firstError
=
str
;
_lastError
=
str
;
_lastError
=
str
;
if
(
GetVerbosity
()
>=
1
)
{
if
(
_logFile
)
fprintf
(
_logFile
,
"Error: %s
\n
"
,
str
);
if
(
_callback
)
(
*
_callback
)(
"Error"
,
str
);
if
(
_client
)
_client
->
Error
(
str
);
#if defined(HAVE_FLTK)
#if defined(HAVE_FLTK)
if
(
FlGui
::
available
()){
if
(
FlGui
::
available
()){
FlGui
::
check
();
FlGui
::
check
();
...
@@ -532,7 +531,6 @@ void Msg::Error(const char *fmt, ...)
...
@@ -532,7 +531,6 @@ void Msg::Error(const char *fmt, ...)
(
CTX
::
instance
()
->
guiColorScheme
?
FL_DARK_RED
:
FL_RED
);
(
CTX
::
instance
()
->
guiColorScheme
?
FL_DARK_RED
:
FL_RED
);
}
}
#endif
#endif
if
(
CTX
::
instance
()
->
terminal
){
if
(
CTX
::
instance
()
->
terminal
){
const
char
*
c0
=
""
,
*
c1
=
""
;
const
char
*
c0
=
""
,
*
c1
=
""
;
if
(
!
streamIsFile
(
stderr
)
&&
streamIsVT100
(
stderr
)){
if
(
!
streamIsFile
(
stderr
)
&&
streamIsVT100
(
stderr
)){
...
@@ -544,9 +542,10 @@ void Msg::Error(const char *fmt, ...)
...
@@ -544,9 +542,10 @@ void Msg::Error(const char *fmt, ...)
fprintf
(
stderr
,
"%sError : %s%s
\n
"
,
c0
,
str
,
c1
);
fprintf
(
stderr
,
"%sError : %s%s
\n
"
,
c0
,
str
,
c1
);
fflush
(
stderr
);
fflush
(
stderr
);
}
}
}
if
(
CTX
::
instance
()
->
abortOnError
==
2
)
{
if
(
CTX
::
instance
()
->
abortOnError
==
2
)
{
throw
1
;
throw
_lastError
;
}
}
else
if
(
CTX
::
instance
()
->
abortOnError
==
3
)
{
else
if
(
CTX
::
instance
()
->
abortOnError
==
3
)
{
Exit
(
1
);
Exit
(
1
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment