- read_all $fh, my $buf, 1 or throw 'Expected inner header type';
- my ($type) = unpack('C', $buf);
-
- read_all $fh, $buf, 4 or throw 'Expected inner header size', type => $type;
- my ($size) = unpack('L<', $buf);
+ read_all $fh, my $buf, 5 or throw 'Expected inner header type and size',
+ compression_error => $IO::Uncompress::Gunzip::GunzipError,
+ crypt_error => $File::KDBX::IO::Crypt::ERROR,
+ hmac_error => $File::KDBX::IO::HmacBLock::ERROR;
+ my ($type, $size) = unpack('C L<', $buf);