Skip to content

Commit 1293451

Browse files
authored
Bound Check: Better Msg (#890)
Make the message more readable. Before: ``` terminate called after throwing an instance of 'std::runtime_error' what(): Chunk does not reside inside dataset (Dimension on index 1 - DS: 1 - Chunk: 1024) ``` After: ``` terminate called after throwing an instance of 'std::runtime_error' what(): Chunk does not reside inside dataset (Dimension on index 1. DS: 1 - Chunk: 1024) ```
1 parent d493a73 commit 1293451

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/openPMD/RecordComponent.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ RecordComponent::loadChunk(std::shared_ptr< T > data, Offset o, Extent e, double
328328
for( uint8_t i = 0; i < dim; ++i )
329329
if( dse[i] < offset[i] + extent[i] )
330330
throw std::runtime_error("Chunk does not reside inside dataset (Dimension on index " + std::to_string(i)
331-
+ " - DS: " + std::to_string(dse[i])
331+
+ ". DS: " + std::to_string(dse[i])
332332
+ " - Chunk: " + std::to_string(offset[i] + extent[i])
333333
+ ")");
334334
if( !data )
@@ -392,7 +392,7 @@ RecordComponent::storeChunk(std::shared_ptr<T> data, Offset o, Extent e)
392392
for( uint8_t i = 0; i < dim; ++i )
393393
if( dse[i] < o[i] + e[i] )
394394
throw std::runtime_error("Chunk does not reside inside dataset (Dimension on index " + std::to_string(i)
395-
+ " - DS: " + std::to_string(dse[i])
395+
+ ". DS: " + std::to_string(dse[i])
396396
+ " - Chunk: " + std::to_string(o[i] + e[i])
397397
+ ")");
398398

0 commit comments

Comments
 (0)