Mercurial > hg > orthanc-databases
comparison Framework/Common/DatabaseManager.cpp @ 445:cec6a0cd399f pg-transactions
now logging DatabaseCannotSerialize as a warning only with the details (Orthanc will log it as an error after all retries)
author | Alain Mazy <am@osimis.io> |
---|---|
date | Wed, 10 Jan 2024 15:25:03 +0100 |
parents | 326f8304daa1 |
children | 6780dd8b0a66 |
comparison
equal
deleted
inserted
replaced
444:2ca939d02d39 | 445:cec6a0cd399f |
---|---|
491 case ValueType_Integer64: | 491 case ValueType_Integer64: |
492 return dynamic_cast<const Integer64Value&>(value).GetValue(); | 492 return dynamic_cast<const Integer64Value&>(value).GetValue(); |
493 | 493 |
494 default: | 494 default: |
495 // LOG(ERROR) << value.GetType(); | 495 // LOG(ERROR) << value.GetType(); |
496 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); | 496 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, "The returned field is not of the correct type (Integer64)"); |
497 } | 497 } |
498 } | 498 } |
499 } | 499 } |
500 | 500 |
501 | 501 |
509 { | 509 { |
510 int64_t value = ReadInteger64(field); | 510 int64_t value = ReadInteger64(field); |
511 | 511 |
512 if (value != static_cast<int64_t>(static_cast<int32_t>(value))) | 512 if (value != static_cast<int64_t>(static_cast<int32_t>(value))) |
513 { | 513 { |
514 LOG(ERROR) << "Integer overflow"; | 514 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, "Integer overflow"); |
515 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); | |
516 } | 515 } |
517 else | 516 else |
518 { | 517 { |
519 return static_cast<int32_t>(value); | 518 return static_cast<int32_t>(value); |
520 } | 519 } |
544 | 543 |
545 case ValueType_Utf8String: | 544 case ValueType_Utf8String: |
546 return dynamic_cast<const Utf8StringValue&>(value).GetContent(); | 545 return dynamic_cast<const Utf8StringValue&>(value).GetContent(); |
547 | 546 |
548 default: | 547 default: |
549 //LOG(ERROR) << value.Format(); | 548 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, "The returned field is not of the correct type (String)"); |
550 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); | |
551 } | 549 } |
552 } | 550 } |
553 | 551 |
554 | 552 |
555 DatabaseManager::CachedStatement::CachedStatement(const StatementLocation& location, | 553 DatabaseManager::CachedStatement::CachedStatement(const StatementLocation& location, |