Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
1ea7aa45
Commit
1ea7aa45
authored
Nov 07, 2018
by
Mark Olesen
Browse files
STYLE: make dictionary error more descriptive (
#1065
)
parent
201fdf87
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/db/dictionary/dictionary.C
View file @
1ea7aa45
...
...
@@ -248,7 +248,7 @@ void Foam::dictionary::checkITstream
is
.
lineNumber
()
// ioStartLineNumber
);
err
<<
"'"
<<
keyword
<<
"' has "
err
<<
"
Entry
'"
<<
keyword
<<
"' has "
<<
remaining
<<
" excess tokens in stream"
<<
nl
<<
nl
<<
" "
;
is
.
writeList
(
err
,
0
);
...
...
@@ -262,7 +262,7 @@ void Foam::dictionary::checkITstream
<<
"--> FOAM FATAL IO ERROR:"
<<
nl
;
std
::
cerr
<<
"'"
<<
keyword
<<
"' has "
<<
"
Entry
'"
<<
keyword
<<
"' has "
<<
remaining
<<
" excess tokens in stream"
<<
nl
<<
nl
;
std
::
cerr
...
...
@@ -286,7 +286,8 @@ void Foam::dictionary::checkITstream
this
->
name
(),
// ioFileName
is
.
lineNumber
()
// ioStartLineNumber
)
<<
"'"
<<
keyword
<<
"' had no tokens in stream"
<<
nl
<<
nl
<<
"Entry '"
<<
keyword
<<
"' had no tokens in stream"
<<
nl
<<
nl
<<
exit
(
FatalIOError
);
}
else
...
...
@@ -294,7 +295,8 @@ void Foam::dictionary::checkITstream
std
::
cerr
<<
nl
<<
"--> FOAM FATAL IO ERROR:"
<<
nl
<<
"'"
<<
keyword
<<
"' had no tokens in stream"
<<
nl
<<
nl
;
<<
"Entry '"
<<
keyword
<<
"' had no tokens in stream"
<<
nl
<<
nl
;
std
::
cerr
<<
"file: "
<<
this
->
name
()
...
...
@@ -358,7 +360,7 @@ const Foam::entry& Foam::dictionary::lookupEntry
if
(
!
finder
.
found
())
{
FatalIOErrorInFunction
(
*
this
)
<<
"'"
<<
keyword
<<
"' not found in dictionary "
<<
"
Entry
'"
<<
keyword
<<
"' not found in dictionary "
<<
name
()
<<
exit
(
FatalIOError
);
}
...
...
@@ -472,7 +474,7 @@ const Foam::dictionary& Foam::dictionary::subDict(const word& keyword) const
if
(
!
finder
.
found
())
{
FatalIOErrorInFunction
(
*
this
)
<<
"'"
<<
keyword
<<
"' not found in dictionary "
<<
"
Entry
'"
<<
keyword
<<
"' not found in dictionary "
<<
name
()
<<
exit
(
FatalIOError
);
}
...
...
@@ -489,7 +491,7 @@ Foam::dictionary& Foam::dictionary::subDict(const word& keyword)
if
(
!
finder
.
found
())
{
FatalIOErrorInFunction
(
*
this
)
<<
"'"
<<
keyword
<<
"' not found in dictionary "
<<
"
Entry
'"
<<
keyword
<<
"' not found in dictionary "
<<
name
()
<<
exit
(
FatalIOError
);
}
...
...
@@ -516,7 +518,7 @@ Foam::dictionary Foam::dictionary::subOrEmptyDict
if
(
mandatory
)
{
FatalIOErrorInFunction
(
*
this
)
<<
"'"
<<
keyword
<<
"
Entry
'"
<<
keyword
<<
"' is not a sub-dictionary in dictionary "
<<
name
()
<<
exit
(
FatalIOError
);
...
...
@@ -525,7 +527,7 @@ Foam::dictionary Foam::dictionary::subOrEmptyDict
if
(
finder
.
found
())
{
IOWarningInFunction
(
*
this
)
<<
"'"
<<
keyword
<<
"
Entry
'"
<<
keyword
<<
"' found but not a sub-dictionary in dictionary "
<<
name
()
<<
endl
;
}
...
...
@@ -551,7 +553,7 @@ const Foam::dictionary& Foam::dictionary::optionalSubDict
if
(
finder
.
found
())
{
IOWarningInFunction
(
*
this
)
<<
"'"
<<
keyword
<<
"
Entry
'"
<<
keyword
<<
"' found but not a sub-dictionary in dictionary "
<<
name
()
<<
endl
;
}
...
...
@@ -639,7 +641,7 @@ Foam::entry* Foam::dictionary::add(entry* entryPtr, bool mergeEntry)
IOWarningInFunction
(
*
this
)
<<
"
p
roblem replacing entry "
<<
entryPtr
->
keyword
()
<<
"
P
roblem replacing entry "
<<
entryPtr
->
keyword
()
<<
" in dictionary "
<<
name
()
<<
endl
;
parent_type
::
remove
(
entryPtr
);
...
...
@@ -665,9 +667,8 @@ Foam::entry* Foam::dictionary::add(entry* entryPtr, bool mergeEntry)
IOWarningInFunction
(
*
this
)
<<
"attempt to add entry "
<<
entryPtr
->
keyword
()
<<
" which already exists in dictionary "
<<
name
()
<<
endl
;
<<
"Attempt to add entry "
<<
entryPtr
->
keyword
()
<<
" which already exists in dictionary "
<<
name
()
<<
endl
;
delete
entryPtr
;
return
nullptr
;
...
...
@@ -772,7 +773,8 @@ bool Foam::dictionary::merge(const dictionary& dict)
if
(
this
==
&
dict
)
{
FatalIOErrorInFunction
(
*
this
)
<<
"attempted merge to self for dictionary "
<<
name
()
<<
"Attempted merge to self for dictionary "
<<
name
()
<<
abort
(
FatalIOError
);
}
...
...
@@ -840,7 +842,8 @@ void Foam::dictionary::operator=(const dictionary& rhs)
if
(
this
==
&
rhs
)
{
FatalIOErrorInFunction
(
*
this
)
<<
"attempted assignment to self for dictionary "
<<
name
()
<<
"Attempted assignment to self for dictionary "
<<
name
()
<<
abort
(
FatalIOError
);
}
...
...
src/OpenFOAM/db/dictionary/dictionaryCompat.C
View file @
1ea7aa45
...
...
@@ -77,7 +77,7 @@ Foam::dictionary::const_searcher Foam::dictionary::csearchCompat
std
::
cerr
<<
"--> FOAM IOWarning :"
<<
nl
<<
" Found [v"
<<
iter
.
second
<<
"] '"
<<
iter
.
first
<<
"' instead of '"
<<
iter
.
first
<<
"'
entry
instead of '"
<<
keyword
.
c_str
()
<<
"' in dictionary
\"
"
<<
name
().
c_str
()
<<
"
\"
"
<<
nl
...
...
@@ -128,7 +128,7 @@ const Foam::entry& Foam::dictionary::lookupEntryCompat
if
(
!
finder
.
found
())
{
FatalIOErrorInFunction
(
*
this
)
<<
"'"
<<
keyword
<<
"' not found in dictionary "
<<
"
Entry
'"
<<
keyword
<<
"' not found in dictionary "
<<
name
()
<<
exit
(
FatalIOError
);
}
...
...
src/OpenFOAM/db/dictionary/dictionaryIO.C
View file @
1ea7aa45
...
...
@@ -89,7 +89,7 @@ bool Foam::dictionary::read(Istream& is, bool keepHeader)
if
(
!
is
.
good
())
{
FatalIOErrorInFunction
(
is
)
<<
"Istream not OK for reading dictionary "
<<
"Istream not OK for reading dictionary "
<<
name
()
<<
exit
(
FatalIOError
);
return
false
;
...
...
@@ -102,7 +102,7 @@ bool Foam::dictionary::read(Istream& is, bool keepHeader)
if
(
currToken
==
token
::
END_BLOCK
)
{
FatalIOErrorInFunction
(
is
)
<<
"Dictionary input cannot start with '}'"
<<
"Dictionary input cannot start with '}'"
<<
nl
<<
exit
(
FatalIOError
);
}
else
if
(
currToken
!=
token
::
BEGIN_BLOCK
)
...
...
@@ -185,7 +185,7 @@ void Foam::dictionary::writeEntries(Ostream& os, const bool extraNewLine) const
if
(
!
os
.
good
())
{
WarningInFunction
<<
"Can
'
t write entry "
<<
e
.
keyword
()
<<
"Can
no
t write entry "
<<
e
.
keyword
()
<<
" for dictionary "
<<
name
()
<<
endl
;
}
...
...
src/OpenFOAM/db/dictionary/dictionarySearch.C
View file @
1ea7aa45
...
...
@@ -629,9 +629,8 @@ bool Foam::dictionary::changeKeyword
if
(
iter
()
->
keyword
().
isPattern
())
{
FatalIOErrorInFunction
(
*
this
)
<<
"Old keyword "
<<
oldKeyword
<<
" is a pattern."
<<
"Pattern replacement not yet implemented."
<<
"Old keyword "
<<
oldKeyword
<<
" is a pattern."
<<
nl
<<
"Pattern replacement is not supported."
<<
nl
<<
exit
(
FatalIOError
);
}
...
...
@@ -664,7 +663,7 @@ bool Foam::dictionary::changeKeyword
else
{
IOWarningInFunction
(
*
this
)
<<
"
c
annot rename keyword "
<<
oldKeyword
<<
"
C
annot rename keyword "
<<
oldKeyword
<<
" to existing keyword "
<<
newKeyword
<<
" in dictionary "
<<
name
()
<<
endl
;
return
false
;
...
...
src/OpenFOAM/db/dictionary/dictionaryTemplates.C
View file @
1ea7aa45
...
...
@@ -100,7 +100,8 @@ bool Foam::dictionary::readCompat
else
if
(
mandatory
)
{
FatalIOErrorInFunction
(
*
this
)
<<
"Entry '"
<<
keyword
<<
"' not found in dictionary "
<<
name
()
<<
"Entry '"
<<
keyword
<<
"' not found in dictionary "
<<
name
()
<<
exit
(
FatalIOError
);
}
...
...
@@ -198,7 +199,8 @@ bool Foam::dictionary::readEntry
else
if
(
mandatory
)
{
FatalIOErrorInFunction
(
*
this
)
<<
"Entry '"
<<
keyword
<<
"' not found in dictionary "
<<
name
()
<<
"Entry '"
<<
keyword
<<
"' not found in dictionary "
<<
name
()
<<
exit
(
FatalIOError
);
}
...
...
src/OpenFOAM/db/dictionary/entry/entry.C
View file @
1ea7aa45
...
...
@@ -92,7 +92,7 @@ void Foam::entry::checkITstream(const ITstream& is) const
is
.
lineNumber
()
// ioStartLineNumber
);
err
<<
"'"
<<
keyword
<<
"' has "
err
<<
"
Entry
'"
<<
keyword
<<
"' has "
<<
remaining
<<
" excess tokens in stream"
<<
nl
<<
nl
<<
" "
;
is
.
writeList
(
err
,
0
);
...
...
@@ -106,7 +106,7 @@ void Foam::entry::checkITstream(const ITstream& is) const
<<
"--> FOAM FATAL IO ERROR:"
<<
nl
;
std
::
cerr
<<
"'"
<<
keyword
<<
"' has "
<<
"
Entry
'"
<<
keyword
<<
"' has "
<<
remaining
<<
" excess tokens in stream"
<<
nl
<<
nl
;
std
::
cerr
...
...
@@ -130,7 +130,8 @@ void Foam::entry::checkITstream(const ITstream& is) const
this
->
name
(),
// ioFileName
is
.
lineNumber
()
// ioStartLineNumber
)
<<
"'"
<<
keyword
<<
"' had no tokens in stream"
<<
nl
<<
nl
<<
"Entry '"
<<
keyword
<<
"' had no tokens in stream"
<<
nl
<<
nl
<<
exit
(
FatalIOError
);
}
else
...
...
@@ -138,7 +139,8 @@ void Foam::entry::checkITstream(const ITstream& is) const
std
::
cerr
<<
nl
<<
"--> FOAM FATAL IO ERROR:"
<<
nl
<<
"'"
<<
keyword
<<
"' had no tokens in stream"
<<
nl
<<
nl
;
<<
"Entry '"
<<
keyword
<<
"' had no tokens in stream"
<<
nl
<<
nl
;
std
::
cerr
<<
"file: "
<<
this
->
name
()
...
...
src/OpenFOAM/global/argList/argList.C
View file @
1ea7aa45
...
...
@@ -213,7 +213,7 @@ void Foam::argList::checkITstream(const ITstream& is, const label index)
std
::
cerr
<<
nl
<<
"--> FOAM WARNING:"
<<
nl
<<
"
a
rgument "
<<
index
<<
" has "
<<
"
A
rgument "
<<
index
<<
" has "
<<
remaining
<<
" excess tokens"
<<
nl
<<
nl
;
}
else
if
(
!
is
.
size
())
...
...
@@ -221,7 +221,7 @@ void Foam::argList::checkITstream(const ITstream& is, const label index)
std
::
cerr
<<
nl
<<
"--> FOAM WARNING:"
<<
nl
<<
"
a
rgument "
<<
index
<<
" had no tokens"
<<
nl
<<
nl
;
<<
"
A
rgument "
<<
index
<<
" had no tokens"
<<
nl
<<
nl
;
}
}
...
...
@@ -235,7 +235,7 @@ void Foam::argList::checkITstream(const ITstream& is, const word& optName)
std
::
cerr
<<
nl
<<
"--> FOAM WARNING:"
<<
nl
<<
"
o
ption -"
<<
optName
<<
" has "
<<
"
O
ption -"
<<
optName
<<
" has "
<<
remaining
<<
" excess tokens"
<<
nl
<<
nl
;
}
else
if
(
!
is
.
size
())
...
...
@@ -243,7 +243,7 @@ void Foam::argList::checkITstream(const ITstream& is, const word& optName)
std
::
cerr
<<
nl
<<
"--> FOAM WARNING:"
<<
nl
<<
"
o
ption -"
<<
optName
<<
" had no tokens"
<<
nl
<<
nl
;
<<
"
O
ption -"
<<
optName
<<
" had no tokens"
<<
nl
<<
nl
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment