1

00:00:01,090  -->  00:00:07,760
That's no go ahead and look at the third item which is item 63 and it is about how we can associate

2

00:00:08,000  -->  00:00:13,730
additional information with an exception so that it can help in better debugging.

3

00:00:13,730  -->  00:00:17,230
And it's a very effective tool for debugging purpose.

4

00:00:17,450  -->  00:00:19,890
And the last item we will see in the next list.

5

00:00:20,210  -->  00:00:28,120
So let's just go ahead and extend our code and look at the third item OK let's go ahead and continue

6

00:00:28,120  -->  00:00:29,170
with all of them all.

7

00:00:29,440  -->  00:00:32,980
So earlier we had this API for marching exception.

8

00:00:33,200  -->  00:00:41,350
And here is the exact output and you can see that there is this the Stockbridge's that is getting printed

9

00:00:41,350  -->  00:00:42,130
here.

10

00:00:42,460  -->  00:00:47,210
But sometimes this doctress alone may not be helpful to the debugger.

11

00:00:47,560  -->  00:00:51,700
So the debugger might need some additional information in order to fix the problem.

12

00:00:51,760  -->  00:00:58,160
Many times it might be good enough but not but sometimes the debugger might need some additional information

13

00:00:58,170  -->  00:00:58,370
.

14

00:00:58,630  -->  00:01:05,770
And sometimes the debugger is debugging might want to reproduce the problem and it might be very difficult

15

00:01:05,770  -->  00:01:07,720
to reproduce the error.

16

00:01:08,290  -->  00:01:14,130
So it is better to have more additional information along with the exception.

17

00:01:14,320  -->  00:01:16,120
Sometimes that will be very useful.

18

00:01:16,260  -->  00:01:18,600
An item sixty three is all about that.

19

00:01:18,700  -->  00:01:27,980
So item 63 says that if we go here into API parser it basically say it basically just to include as

20

00:01:27,980  -->  00:01:31,320
much information as possible from the context.

21

00:01:31,430  -->  00:01:37,550
When an exception has been generated for example it suggests that we can use all the parameter Dometic

22

00:01:37,670  -->  00:01:43,380
parameters information and also any any relevant instance valuable information.

23

00:01:43,400  -->  00:01:49,750
So the items are just to pick all of this information and to encapsulate that in the exception itself

24

00:01:49,800  -->  00:01:50,120
.

25

00:01:50,570  -->  00:01:52,460
So that can be done.

26

00:01:52,670  -->  00:01:55,510
Information can be encapsulated because of it into a bill.

27

00:01:55,520  -->  00:01:59,570
There is a constructor which takes a string as an input.

28

00:01:59,810  -->  00:02:07,400
So the items says we can concatenate all of this information and the parameter information on any instance

29

00:02:07,400  -->  00:02:11,790
variable information and we can pass it on unbe can invoke that particular construct.

30

00:02:11,810  -->  00:02:17,990
Here we are invoking a constructor but we can also invoke the other constructor and for that we need

31

00:02:17,990  -->  00:02:21,080
to include it here we need to create that constructor.

32

00:02:21,080  -->  00:02:26,770
So let's just go ahead and see Jenrette constructors from superclass.

33

00:02:27,050  -->  00:02:32,360
So let's just set de-select on and set up this one exception of string.

34

00:02:32,930  -->  00:02:34,110
So this is the thing.

35

00:02:34,160  -->  00:02:41,090
And so we have a new constructor within our odd exception class to simply invoking the constructor from

36

00:02:41,090  -->  00:02:43,990
the superclass which is an exception.

37

00:02:44,010  -->  00:02:48,710
So just go ahead and also pass a string here.

38

00:02:49,010  -->  00:02:51,460
All we need to do is this message here.

39

00:02:55,300  -->  00:02:58,040
So it's a detail message that we are passing.

40

00:02:58,230  -->  00:03:04,380
Just Mode-S So we're passing the response which is from here.

41

00:03:04,430  -->  00:03:11,960
Doctoral response that we got from the lip service and we are also passing the element which is giving

42

00:03:11,960  -->  00:03:16,930
us the problem which is the court and the part not information the name of the partner.

43

00:03:17,120  -->  00:03:21,250
So all of this will be no part of the exception itself.

44

00:03:21,390  -->  00:03:22,100
OK.

45

00:03:22,190  -->  00:03:30,350
And it's a very effective way of dealing with exceptions in certain in certain pieces of court especially

46

00:03:30,350  -->  00:03:36,230
when you are hoping some data integration systems on you if you run into such issues so you can put

47

00:03:36,230  -->  00:03:40,420
inter-regional information on pass it over to the partner beams.

48

00:03:40,490  -->  00:03:41,260
Double up.

49

00:03:41,340  -->  00:03:45,410
So OK so that would be very helpful for them to fix the problem.

50

00:03:45,450  -->  00:03:51,490
And personally also I have encountered such issues and these this kind of additional information has

51

00:03:51,570  -->  00:03:56,930
has really helped me out to fix the problem so I was able to pass a pass on this information to the

52

00:03:56,970  -->  00:03:59,740
excellent other team and they were able to fix it.

53

00:03:59,780  -->  00:04:01,290
So it's really very helpful.

54

00:04:01,460  -->  00:04:03,130
So let's just go back here.

55

00:04:04,270  -->  00:04:07,040
And there's sprint that one more time

56

00:04:10,390  -->  00:04:17,710
so as you can see now the exception that has the stackless as before it opens the exception name and

57

00:04:17,830  -->  00:04:20,510
it's also providing the additional information.

58

00:04:20,740  -->  00:04:24,400
So this is called as a daily message.

59

00:04:24,910  -->  00:04:26,530
So that's the prince doctress matter.

60

00:04:26,560  -->  00:04:27,490
Let's also look at

61

00:04:30,780  -->  00:04:31,970
the string matters.

62

00:04:31,990  -->  00:04:35,380
So this is a prince doctress method from the exception class.

63

00:04:35,380  -->  00:04:39,970
Now let's look at the string third string method basically it prints only the first line and it's not

64

00:04:39,970  -->  00:04:42,090
going to print the stack trace.

65

00:04:44,360  -->  00:04:48,770
So as you can see here you are to string notes printing on the fosterling.

66

00:04:48,770  -->  00:04:55,320
Now there is also a method called Get message which only opens only the original information yes knew

67

00:04:55,370  -->  00:04:55,690
that

68

00:04:59,580  -->  00:05:02,870
you can see here it only provides additional information.

69

00:05:02,870  -->  00:05:09,470
So that's how you can pass additional information but the items is that one problem with this is sometimes

70

00:05:09,470  -->  00:05:15,950
don't the person might want to extract this additional information not the entire string but just the

71

00:05:15,950  -->  00:05:18,910
additional information embedded within the string unfolded.

72

00:05:18,920  -->  00:05:24,850
They might write some parsing code extractor But the problem with that is here.

73

00:05:24,950  -->  00:05:30,560
So we're constructing the string so API Parslow is a different component.

74

00:05:30,580  -->  00:05:30,790
Right.

75

00:05:30,790  -->  00:05:31,500
It's not.

76

00:05:31,650  -->  00:05:37,370
So exceptions demo is actually incorporating API parser now in the next release.

77

00:05:37,370  -->  00:05:42,330
If this you know if there are changes Disfarmer so I can start off response.

78

00:05:42,370  -->  00:05:48,520
If he changes it to something else and if he or if an exception is demo we are using this particular

79

00:05:48,520  -->  00:05:54,780
string to parse the response then because the format has been changed in the next release due to that

80

00:05:55,480  -->  00:05:59,140
you know the code or here might break the parsing code might break.

81

00:05:59,140  -->  00:06:08,370
So the items say is that you have certain parameters since exception class is simply an exception.

82

00:06:08,380  -->  00:06:09,780
It's simply a class.

83

00:06:09,880  -->  00:06:11,960
So why not have some parameters.

84

00:06:12,010  -->  00:06:17,770
Why not House officials here that represent the artist the individual feels individual values within

85

00:06:17,770  -->  00:06:19,440
the additional information.

86

00:06:19,570  -->  00:06:27,070
The response the element and the partner so we can maintain individual individual feels here and we

87

00:06:27,070  -->  00:06:34,060
can expose them through some access sort of metrics and to initialize them we can have a new constructor

88

00:06:34,250  -->  00:06:34,670
.

89

00:06:34,960  -->  00:06:40,570
So when we are invoking the ax instead of invoking this particular constructor we will invoke a new

90

00:06:40,570  -->  00:06:46,930
constructor which will actually initialize all those fields which represent this these individual elements

91

00:06:46,930  -->  00:06:48,830
within the traditional information.

92

00:06:48,850  -->  00:06:54,160
So that's the suggestion that that item gives and it is not followed.

93

00:06:54,160  -->  00:06:59,640
It seems according to Josh Block it's not even followed well within the Java library itself.

94

00:06:59,800  -->  00:07:03,650
But he highlighted the comments following this particular idiom.

95

00:07:03,760  -->  00:07:05,350
So let's just go ahead and do that.

96

00:07:07,210  -->  00:07:09,150
So let's first introduce those variables

97

00:07:23,160  -->  00:07:28,060
it's automatically created construct or BART we are.

98

00:07:28,090  -->  00:07:29,440
It's a new constructor.

99

00:07:29,490  -->  00:07:34,320
So we are going to join de-construct de-construct from the fetus.

100

00:07:34,700  -->  00:07:36,950
Just say all of the pentameters on this.

101

00:07:36,960  -->  00:07:39,920
So I think it's also a way to access some of my thoughts here.

102

00:07:42,370  -->  00:07:46,120
So generous good persons are cursed under this system set up get us

103

00:07:50,190  -->  00:07:55,870
so we have all the accessories here and the fields are initialized here.

104

00:07:56,210  -->  00:08:01,660
And we can also in the superclasses string constructor in this way.

105

00:08:04,900  -->  00:08:08,060
So you're also doing that and in addition to that we are doing this.

106

00:08:08,330  -->  00:08:08,740
OK.

107

00:08:08,770  -->  00:08:12,460
So that's the nice thing unbecome now for summer.

108

00:08:12,520  -->  00:08:17,360
Double up Perkel actually work only this particular constructor

109

00:08:29,450  -->  00:08:36,820
so this is how we look at a nice string is also getting constructed here.

110

00:08:36,950  -->  00:08:43,440
And if the client wants they can actually get the individual values of the additional information.

111

00:08:44,370  -->  00:08:55,130
Sophie go back here in let's say the developer wants only the element name so you can do that.

112

00:08:56,940  -->  00:09:02,850
You can see just getting anywhere near widgets or so that's about it.

113

00:09:03,290  -->  00:09:05,820
That's how we can capture additional information.

114

00:09:06,100  -->  00:09:11,660
Our industrial block highly recommends using this particular idiom for capturing additional information

115

00:09:11,660  -->  00:09:12,330
.

116

00:09:12,410  -->  00:09:12,720
OK.

117

00:09:12,740  -->  00:09:18,230
Next we will look at the final item and that's also an interesting item on we would look at it in the

118

00:09:18,230  -->  00:09:19,060
next lesson.

119

00:09:19,220  -->  00:09:19,790
Thank you.
