# HG changeset patch # User Chris Cannam # Date 1400589380 -3600 # Node ID 5474b55b3071d69742b06a2b1fb925d9bc4e5e92 # Parent aca6a6604fdc06a9dd636b797361ca8025761766 More informative error output diff -r aca6a6604fdc -r 5474b55b3071 src/may/stream/format.yeti --- a/src/may/stream/format.yeti Tue May 20 13:36:02 2014 +0100 +++ b/src/may/stream/format.yeti Tue May 20 13:36:20 2014 +0100 @@ -29,12 +29,12 @@ done ); -decodeFail () = - throw new UnsupportedAudioFileException("Audio format not supported. Supported formats are 8-bit unsigned PCM, 16-bit signed little-endian PCM, or IEEE float"); +decodeFail f is ~AudioFormat -> () = + throw new UnsupportedAudioFileException("Audio format \"\(f#toString())\" not supported. Supported formats are 8-bit unsigned PCM, 16-bit signed little-endian PCM, or IEEE float."); decode { format is ~AudioFormat } bytes doubles n = (if format#isBigEndian() then - decodeFail() + decodeFail format; else enc = format#getEncoding(); bits = format#getSampleSizeInBits(); @@ -45,7 +45,7 @@ elif bits == 8 and enc == AudioFormat$Encoding#PCM_UNSIGNED then decode8u bytes doubles n; else - decodeFail(); + decodeFail format; fi fi);