public class Rethrow {
    static void prosesPesanan(String id) {
        try {
            int nomor = Integer.parseInt(id);
            System.out.println("pesanan " + nomor + " diproses");
        } catch (NumberFormatException e) {
            System.out.println("mencatat ke log: id pesanan salah -> " + id);
            throw e; // melempar ulang exception yang sama
        }
    }

    public static void main(String[] args) {
        try {
            prosesPesanan("A-17");
        } catch (NumberFormatException e) {
            System.out.println("pemanggil menerima: " + e.getMessage());
        }
    }
}
