mirror of
https://github.com/TheAlgorithms/Java.git
synced 2026-03-13 08:40:43 +08:00
style: include LEST_LOST_EXCEPTION_STACK_TRACE (#5150)
This commit is contained in:
@@ -10,4 +10,8 @@ public class EmptyHeapException extends Exception {
|
||||
public EmptyHeapException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public EmptyHeapException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ public class MaxHeap implements Heap {
|
||||
try {
|
||||
return extractMax();
|
||||
} catch (Exception e) {
|
||||
throw new EmptyHeapException("Heap is empty. Error retrieving element");
|
||||
throw new EmptyHeapException("Heap is empty. Error retrieving element", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ public class MinHeap implements Heap {
|
||||
try {
|
||||
return extractMin();
|
||||
} catch (Exception e) {
|
||||
throw new EmptyHeapException("Heap is empty. Error retrieving element");
|
||||
throw new EmptyHeapException("Heap is empty. Error retrieving element", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user