|
|
TBF I did omit the 'Send Codz Urgent!' banner
veni bibi saltavi
|
|
|
|
|
|
Is this you: Kamen Nikolov?
|
|
|
|
|
How'd you know?
modified 20-Oct-19 21:02pm.
|
|
|
|
|
your article's comment section from other users. "Hello Kamen" --> basic search on site after that.
Interesting is all.
|
|
|
|
|
Oh and if the app has some native code, you can store it in the "code behind" in the app's internal storage AND encrypted
modified 20-Oct-19 21:02pm.
|
|
|
|
|
Your rant made me laugh because you described the entire process of dealing with user authentication just as I experience it each time I have to deal with it.
Dealing with it is basically like a stroke, topped off with an brain aneurysm ,salted with plenty of cursing.
modified 21-May-19 16:17pm.
|
|
|
|
|
Another Lounge thread that should be a discussion on the C# language forum, where its value might have a chance to benefit others in the future.
Please, go ahead and report me for posting code with a positive intent to make CP better; I'll wear the scars as a badge of honor
A catch without a throw is a homeless kitten
public static class TheMotherOfAllExceptionHandlers
{
public static string ThrowToMama(this Exception ex, bool doLog = true,
[CallerMemberName] string propertyName = null)
{
StringBuilder sb = new StringBuilder();
string log = sb.ToString();
if (doLog)
{
Logger(log);
}
return log;
}
public static void Logger(string data)
{
}
} For an in-depth exposition by Michaelis on some advanced Exception handling techniques in C# >= 5: [^]
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot
|
|
|
|
|
Is buzz-kill a fly swatter?
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Ah - as stinging pun, but let's bee sensible so we get moth responses that ant too cynical.
Note: if it's on the web, before long the buzz will be killed.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
No. It's one of these.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
I thought buzz-kill was Narcan.
/ravi
|
|
|
|
|
* Other medications are available, including generic Naloxone Hydrochloride with the same or similar efficaciousness at a lower cost point.
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
catch (Exception)
Look, if you're going to catch an exception, at least give it a variable so in the debugger I can see what the exception is.
All because someone doesn't want to see "'ex' is declared but never used." Well, use it, FFS.
Latest Article - A 4-Stack rPI Cluster with WiFi-Ethernet Bridging
Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny
Artificial intelligence is the only remedy for natural stupidity. - CDP1802
|
|
|
|
|
I often do this to avoid the warning:
catch (Exception ex)
{
if (ex != null) {}
} This way, if I'm debugging, I can always examine it, even if I ignore it in the code. I'm often called out for doing this in some of my articles here.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
It's kiddie code; the "politically correct" version of: ON ERROR GOTO <endlabel>
(btw: there's lots of that in public git code)
Message Signature
(Click to edit ->)
|
|
|
|
|
"But I don't C-A-R-E what the Exception is, I'm just required put it in the code. Gah!"
To be read as whiny as possible.
|
|
|
|
|
|
cheers, Bill
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot
modified 22-May-19 0:30am.
|
|
|
|
|
Dont fizzle with such details. Important is that the app doesnt crash for now and doesnt spit on the logs or debugger.
Never heard of "agile" development style?
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
KarstenK wrote: Dont fizzle with such details. Important is that the app doesnt crash for now Famous last words.
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot
|
|
|
|
|
"We fix it in the next sprint." says my boss
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Which brings us to another philosophical question: What to do with an exception that does not hurt, can't be prevented, nor meaningfully handled?
Sweep it under the rug, like it is done here? Maybe there is not much you can do about it once it has happened. Maybe it's not harmful, but then you would be using exceptions as a means to control program flow. That's not a good idea.
I would say that it's better to use such Pokemon exception handlers to catch and log all unexpected exceptions and log them away. Once in a while someone should read these logs and take a look if this exception can be prevented or handled. Sweeping this under the rug is just lazy.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
CodeWraith wrote: What to do with an exception that does not hurt, can't be prevented, nor meaningfully handled?
In most cases, the "expected exception" will be a more derived type than System.Exception . The catch block should catch that derived type, and have a suitable comment to explain why it's ignoring the exception.
Of course, there are always exceptions. Back in the early days of .NET, certain invalid input passed to the ColorTranslator.FromHtml[^] method would deliberately catch a FormatException and wrap it in a System.Exception , which made it painful to catch. (Especially as this pre-dated C#'s access to exception filters, and before C# stopped handling corrupted state exceptions[^] by default.)
I reported the bug on the Connect site (which was "retired" last year[^], deleting all of the information collected there). I was told that it couldn't possibly be fixed, because that could be a breaking change. They couldn't even change it to wrap the FormatException in another FormatException , in case somebody had written code which relied on the exact exception type.
Thankfully, they seem to have come to their senses and fixed it sometime around .NET 2.0.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|