Triggering An Exception

2 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$99.99
List Price:  $139.99
You save:  $40
€84.76
List Price:  €118.67
You save:  €33.90
£73.97
List Price:  £103.56
You save:  £29.59
CA$136.71
List Price:  CA$191.40
You save:  CA$54.68
A$148.95
List Price:  A$208.53
You save:  A$59.58
S$128.33
List Price:  S$179.67
You save:  S$51.33
HK$777.43
List Price:  HK$1,088.43
You save:  HK$311
CHF 78.67
List Price:  CHF 110.14
You save:  CHF 31.47
NOK kr999.60
List Price:  NOK kr1,399.49
You save:  NOK kr399.88
DKK kr633.13
List Price:  DKK kr886.41
You save:  DKK kr253.27
NZ$171.03
List Price:  NZ$239.45
You save:  NZ$68.41
د.إ367.21
List Price:  د.إ514.11
You save:  د.إ146.90
৳12,208.18
List Price:  ৳17,091.94
You save:  ৳4,883.76
₹8,975.60
List Price:  ₹12,566.20
You save:  ₹3,590.59
RM404.95
List Price:  RM566.95
You save:  RM162
₦145,323.46
List Price:  ₦203,458.66
You save:  ₦58,135.20
₨27,986.23
List Price:  ₨39,181.84
You save:  ₨11,195.61
฿3,103.71
List Price:  ฿4,345.32
You save:  ฿1,241.61
₺4,284.60
List Price:  ₺5,998.61
You save:  ₺1,714.01
B$551.84
List Price:  B$772.60
You save:  B$220.76
R1,662.06
List Price:  R2,326.95
You save:  R664.89
Лв165.85
List Price:  Лв232.20
You save:  Лв66.34
₩144,900.53
List Price:  ₩202,866.53
You save:  ₩57,966
₪317.94
List Price:  ₪445.13
You save:  ₪127.19
₱5,870.72
List Price:  ₱8,219.24
You save:  ₱2,348.52
¥15,592.05
List Price:  ¥21,829.49
You save:  ¥6,237.44
MX$1,788.66
List Price:  MX$2,504.20
You save:  MX$715.53
QR365.16
List Price:  QR511.24
You save:  QR146.08
P1,315
List Price:  P1,841.05
You save:  P526.05
KSh12,888.71
List Price:  KSh18,044.71
You save:  KSh5,156
E£4,758
List Price:  E£6,661.39
You save:  E£1,903.39
ብር15,565.56
List Price:  ብር21,792.40
You save:  ብር6,226.84
Kz91,219.48
List Price:  Kz127,710.93
You save:  Kz36,491.44
CLP$90,409.95
List Price:  CLP$126,577.55
You save:  CLP$36,167.60
CN¥701.35
List Price:  CN¥981.93
You save:  CN¥280.57
RD$6,234.52
List Price:  RD$8,728.58
You save:  RD$2,494.06
DA12,940.63
List Price:  DA18,117.41
You save:  DA5,176.77
FJ$226.89
List Price:  FJ$317.66
You save:  FJ$90.76
Q765.41
List Price:  Q1,071.60
You save:  Q306.19
GY$20,901.45
List Price:  GY$29,262.87
You save:  GY$8,361.41
ISK kr12,544.74
List Price:  ISK kr17,563.14
You save:  ISK kr5,018.40
DH911.22
List Price:  DH1,275.75
You save:  DH364.52
L1,681.27
List Price:  L2,353.85
You save:  L672.57
ден5,216.43
List Price:  ден7,303.22
You save:  ден2,086.78
MOP$800.38
List Price:  MOP$1,120.56
You save:  MOP$320.18
N$1,667.72
List Price:  N$2,334.87
You save:  N$667.15
C$3,676.68
List Price:  C$5,147.50
You save:  C$1,470.82
रु14,337.63
List Price:  रु20,073.25
You save:  रु5,735.62
S/336.27
List Price:  S/470.80
You save:  S/134.52
K425.20
List Price:  K595.30
You save:  K170.10
SAR375.02
List Price:  SAR525.04
You save:  SAR150.02
ZK2,257.84
List Price:  ZK3,161.07
You save:  ZK903.22
L431.34
List Price:  L603.90
You save:  L172.55
Kč2,057.26
List Price:  Kč2,880.25
You save:  Kč822.98
Ft32,996.22
List Price:  Ft46,196.04
You save:  Ft13,199.81
SEK kr916.37
List Price:  SEK kr1,282.96
You save:  SEK kr366.58
ARS$145,032.42
List Price:  ARS$203,051.19
You save:  ARS$58,018.77
Bs693.09
List Price:  Bs970.36
You save:  Bs277.26
COP$379,170.81
List Price:  COP$530,854.31
You save:  COP$151,683.49
₡49,430.57
List Price:  ₡69,204.78
You save:  ₡19,774.20
L2,633.47
List Price:  L3,686.97
You save:  L1,053.49
₲680,707.19
List Price:  ₲953,017.31
You save:  ₲272,310.11
$U3,908.03
List Price:  $U5,471.40
You save:  $U1,563.37
zł356.97
List Price:  zł499.77
You save:  zł142.80
Already have an account? Log In

Transcript

Hello, in this video, I am going to show you how to trigger an error. So this would trigger an error, you know, because the problem would be if you essentially want to trigger an error manually. So that might not be a problem that would generally, you know, trigger the error. But you know, maybe the user input some data, let's do something like that I'm not gonna do it, like any sort of input, who's gonna have dollar or equals 10, or maybe 10s, invalid, and put 11, maybe type a zero to 10. So let's say if I put $1, I am greater than 10, then we're going to basically trigger an error trigger the error and we just do throw new exception. And we just say whatever the error is, number if we reload that, we get uncaught exception number two large.

So as you can see, we have, you know, thrown an error thrown an exception. And if we want to actually override the exception, so it actually has a custom method instead of error handler, you want to do exception. So set exception handler, and we'll rename this to exception should just be dollar section a bit more basic. And we can do it from here. connection and get an individual Return. So what we can do get the message through a bunch of other stuff and I recommend having a look at what else you can do as well.

There you go number two large, or I'm also going to do is append a string or say an exception. And they are number two large. So that is how you trigger an error and exception manually. So that's it. If you have any questions, feel free to pop me a message. And as usual, I look forward to seeing you in the next video.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.