Self-Deployed Try Catch Blocks #8551
Unanswered
ndelaquintana
asked this question in
Language Ideas
Replies: 1 comment
-
See: #220 Also, it helps to format the code and put it into code blocks for the purposes of readability. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
/* CASE 1
public void Save()
{
try
{
client.Do();
}
catch (Exception e)
{
client.Log(e);
}
finally
{
client.Dispose();
}
}
public void NewSave()
try => client.Do();
catch (Exception e) => client.Log(e);
finally => client.Dispose();
*/
/* CASE 2
public void Save()
{
try
{
client.Do();
}
catch
{
}
finally
{
}
}
public void NewSave()
try => client.Do();
*/
/* CASE 3
void Work(Client client)
{
while (true)
{
try
{
client.Do();
}
catch (Exception e)
{
}
}
}
void NewWork(Client client)
{
while (true) try => client.Do();
}
*/
Beta Was this translation helpful? Give feedback.
All reactions