We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 669db42 commit dea4134Copy full SHA for dea4134
lesson_14/exceptions/exceptions_app/src/main/java/com/codedifferently/lesson14/Lesson14.java
@@ -3,6 +3,16 @@
3
public class Lesson14 {
4
5
public static void main(String[] args) {
6
- System.out.println("Hello World");
+ // System.out.println("Hello World");
7
+ try {
8
+ ecommerceSystem.placeOrder("1", 1);
9
+ } catch (ProductNotFoundException e) {
10
+ System.out.println("Product not found.");
11
+ } catch (OrderNotFoundException e){
12
+ System.out.println("Order not found.");
13
+ }
14
}
15
16
+
17
+//ProductNotFoundException <- for product does not exist
18
+//OrderNotFoundException <- for both order does not exist and order cancelled
0 commit comments