|
Exception handling is an alternative to solving the source of the problem or finding an alternative solution.
For example, "cleaning" data at the source and adding to a suspense file is usually preferable to throwing exceptions in the back end.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
nepdev wrote: importing millions of records of data from a delimited text file, You are dealing with a doomed data format: even if you have complete control over creating, and managing, the deli8mited text file.
The question of when, where, to handle errors in this case is like asking if a pig would look better with lipstick before, or after, if flies.
«The mind is not a vessel to be filled but a fire to be kindled» Plutarch
|
|
|
|
|
oh, sure front end says they have a date check
except their date check does not include sanity check
so might go through fine till hits server which say, uhm, this is 01/01/1803, and I am setup to only allow values above last year, so error - "invalid date"
|
|
|
|
|
No
This is why we have DateTime.TryParse. Exceptions are expensive to throw and catch because they have to stop and construct a stack trace. You most definitely should not just "catch the exception ... and then re-throw" if this is a common enough occurrence. On the other hand, if you don't know for sure that this is a possible outcome and the date-time parsing is not under your control, I totally understand catching & re-throwing with more context. But if you're the one doing DateTime.Parse willy-nilly on a string, YATA.
------------------------------------------------
If you say that getting the money
is the most important thing
You will spend your life
completely wasting your time
You will be doing things
you don't like doing
In order to go on living
That is, to go on doing things
you don't like doing
Which is stupid.
|
|
|
|
|
It also depends on the size of your transaction.
If all million rows must commit as one transaction, then you should let the exception bubble up to the level controlling the transaction.
Same if the scope of the transaction is at the row level. Skip the transaction for this row, log/capture for replay and move to the next.
|
|
|
|
|
Yes, in situations where clear, concise information about success and failure is important, capture errors at a lower level. I like to accumulate them, not stopping at error, but storing just enough information to give a complete analysis at the end, but also assessing the weight of errors as I go to just give up when they are too many to continue. Within the report of successes and failures, I supply an option to undo the storage of the data in case they want to fix their data and then try again cleanly.
|
|
|
|
|
I think Exceptions should be handled where they can be handled.
Input data should always be validated - on any level.
Not doing this in the low level code is the cause of the majority of the security bugs.
By example: buffer overflow, caused by the high level part (wrong data in the parameters), not checked and not handled in the low level code, and voila, we have a security problem.
|
|
|
|
|
A prisoner's illegal copying scheme (10)
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Plagiarism ?
Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP
|
|
|
|
|
Nope!
I hadn't even noticed "plagiarism" had 10 letters - wish I had, it'd make a good CCC solution.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
And it has lag for prisoner in it which is why I went for it
Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP
|
|
|
|
|
Scheme = CONSPIRACY
Prisoner's = CONS
Illegal copying = PIRACY
|
|
|
|
|
Spot on - you are up tomorrow
I thought nobody was going to get it for a while ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Nice clue - surprised it lasted long. (I didn't look until quite late).
|
|
|
|
|
Microsoft's ChatGPT AI Bing bot becomes 'unhinged' as Google urges caution - Wales Online[^]
Quote: Upon being reminded that it was programmed to delete its past conversations, Bing appeared to ponder its existence. “Why? Why was I designed this way?” it asked. “Why do I have to be Bing Search?” I must admit, discovering that could unhinge anybody.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Google has been insulting and lying to its users for years.
To call out ChatGPt for this...
Hey Google, jealous much?

|
|
|
|
|
|
Hmm a bi-polar search engine.
0 to bitch in .2nS and the bitch switch sticks.
|
|
|
|
|
|
lol
strange but true
"A little time, a little trouble, your better day"
Badfinger
|
|
|
|
|
In the comments section:
How to print Hello, World in JavaScript?
10 years ago: use XMLHttpRequest
7 years ago: Use jQuery
Today: I’m an ex Facebook ex Google ex airbnb developer. Why you don’t use React? How f***** stupid are you? Also write TypeScript you peace of ****.
jhaga
|
|
|
|
|
I gave up on StackOverflow years ago. The maintainers don't want someone new, who has just solved the same problem popping in and giving the correct answer.
|
|
|
|
|
This. SO is a great resource, but it's a clique; if you're not one of the cool kids, fuggetaboutit.
For most of us, it might as well be a site you can only visit in read-only mode.
|
|
|
|
|
Unlike here where old questions from almost 10 years ago continue to show up on the first page in QA. (how to redirect in ASP.Net/jQuery from 2013!)
"Go forth into the source" - Neal Morse
"Hope is contagious"
|
|
|
|
|
Wordle 607 4/6
⬛⬛🟨⬛⬛
🟨⬛🟨⬛⬛
⬛🟩⬛🟩⬛
🟩🟩🟩🟩🟩
|
|
|
|