Skip to content

Commit ede1534

Browse files
committed
Improved error reporting
Changed two error messages in get_char_keys so that they used error stop instead of stop and provided more detailed information. [ticket: X]
1 parent ea7d80f commit ede1534

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/stdlib_hashmap_wrappers.f90

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,16 +212,22 @@ subroutine get_char_key( key, value )
212212
error stop module_name // " % " // procedure // &
213213
": Internal Error at stdlib_hashmaps: " // &
214214
"System uses 2 bytes per character, so " // &
215-
"key_size can't be an odd number"
215+
"key_size can't be an odd number."
216216
end if
217217
key_as_char = ishft( key_size, -1 )
218218
case(4)
219219
if ( iand( key_size, 3_int64) > 0 ) then
220-
stop 'KEY does not map to a character string.'
220+
error stop module_name // " % " // procedure // &
221+
": Internal Error at stdlib_hashmaps: " // &
222+
"System uses 4 bytes per character, and " // &
223+
"key_size is not a multiple of four."
221224
end if
222225
key_as_char = ishft( key_size, -2 )
223226
case default
224-
stop 'CHARACTER has an unrecognized size.'
227+
error stop module_name // " % " // procedure // &
228+
": Internal Error: " // &
229+
"System doesn't use a power of two for its " // &
230+
"character size as expected by stdlib_hashmaps."
225231
end select
226232

227233
allocate( character( len=key_as_char ) :: value )

0 commit comments

Comments
 (0)