File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
lesson_14/exceptions/exceptions_app/src/main/java/com/codedifferently/lesson14 Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 1
1
package com .codedifferently .lesson14 ;
2
2
3
+ import com .codedifferently .lesson14 .ecommerce .EcommerceSystem ;
4
+ import com .codedifferently .lesson14 .ecommerce .OrderNotFoundException ;
5
+ import com .codedifferently .lesson14 .ecommerce .ProductNotFoundException ;
6
+
3
7
public class Lesson14 {
4
8
5
9
public static void main (String [] args ) {
6
- // System.out.println("Hello World") ;
10
+ String orderId = null ;
7
11
try {
8
- String orderId = ecommerceSystem .placeOrder ("1" , 1 );
12
+ orderId = ecommerceSystem .placeOrder ("1" , 1 );
9
13
} catch (ProductNotFoundException e ) {
10
- System .out .println ("Product with ID " + orderId + " not found." );
14
+ System .out .println ("Product with ID " + "1" + " not found." );
11
15
} catch (OrderNotFoundException e ){
12
16
System .out .println ("Order with ID " + orderId + " not found." );
13
17
}
You can’t perform that action at this time.
0 commit comments