mirror of
https://github.com/FreeOpcUa/freeopcua
synced 2025-10-26 19:56:54 +08:00
Compare commits
2 Commits
0b73589ad3
...
08c7205308
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
08c7205308 | ||
|
|
84a7880c19 |
|
|
@ -167,7 +167,7 @@ time_t DateTime::ToTimeT(DateTime dateTime)
|
|||
if (dateTime.Value < secsFrom1601To1970)
|
||||
{
|
||||
std::stringstream stream;
|
||||
stream << "OpcUa date time cannot be less than " << secsFrom1601To1970;
|
||||
stream << "OpcUa date time cannot be less than " << secsFrom1601To1970 << ". Current value: " << dateTime.Value;
|
||||
throw std::invalid_argument(stream.str());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -423,7 +423,15 @@ std::ostream & OpcUa::ToStream(std::ostream & os, const OpcUa::Event & value, in
|
|||
ToStream(os, value.EventType, true);
|
||||
|
||||
indent(os, subIndentLevel);
|
||||
os << "Time: " << value.Time;
|
||||
|
||||
try
|
||||
{
|
||||
os << "Time: " << value.Time;
|
||||
}
|
||||
catch(const std::invalid_argument& e)
|
||||
{
|
||||
os << "Time: INVALID";
|
||||
}
|
||||
|
||||
if (showAll)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user