die "...\n"; 

my $quantity = $line_item->{quantity}
    // die "quantity is not defined: ", Dumper($line_item);
$ ./die-dumper.pl
quantity is not defined $VAR1 = {
  'short_desc' => 'HDMI to SATA Adapter',
  'quantity' => undef,
  'product_id' => 864412,
  'discount_code' => 'PROMO17'
};
$