Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,152,459 members, 7,816,079 topics. Date: Friday, 03 May 2024 at 02:50 AM

Try and Catch Like I am 5 - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Try and Catch Like I am 5 (620 Views)

Lets Start A Real Web-deveopment Course Here Html+css+javascript+php+mysql / Were Can I Download Free Video Tutorials On Javascript Or Ruby / Javascript With NodeJS (2) (3) (4)

(1) (Reply)

Try and Catch Like I am 5 by nettwrock(m): 9:30pm On Feb 18, 2015
.
Re: Try and Catch Like I am 5 by robby1(m): 1:29am On Feb 19, 2015
It's a simple concept.
You have a process or action you want to perform but you think there will be cases where it will fail. You don't want to be caught unawares so you need to tell the compiler what to do when it encounters errors from that action you are performing.
So what you do is wrap the operation in a try-catch block. The names suggest what they do.
This is a simple explanation of how its done.

Try(
whatever process that you think might result in a failure)
Catch(
All it any of the error that you think might result from the operation above)
Throw[b][/b](
What you want to do with the error you just caught above )

Of course there are other things involved like having a finaly() and catching multiple errors/exceptions but understand the basics first.

1 Like

Re: Try and Catch Like I am 5 by nettwrock(m): 7:58am On Feb 19, 2015
Thnks My Oga

(1) (Reply)

Programmer Required For A Financial Reporting Software / Which Picture Protector Is The Better To Use? / Just Arrived Uk Used Asus S400c Touchscreen Core I3 500gb Hdd 4gb Ram Very Slim

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 5
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.