Thread overview | ||||||
---|---|---|---|---|---|---|
|
April 27, 2017 Can't break App execution by ctrl+c | ||||
---|---|---|---|---|
| ||||
Before my code handle empty result in `catch` block. Then I moved it's checking to main loop, and now I can't abort App execution by ctrl+c. It's simply continue working. Here is my code: foreach(cargpspoint; cargpspoints) { auto cmd_dist = new PGCommand(pgconnection, sql_query)); try { auto nresult = cmd_dist.executeQuery(); auto nanswer = nresult.array; nresult.close(); if(nanswer.empty) { continue; } } OS: Windows. |
April 27, 2017 Re: Can't break App execution by ctrl+c | ||||
---|---|---|---|---|
| ||||
Posted in reply to Suliman | On Thursday, 27 April 2017 at 12:17:12 UTC, Suliman wrote:
> Before my code handle empty result in `catch` block.
You must be catching the ctrl+c exception... don't do that. Just catch the empty result exception.
|
April 27, 2017 Re: Can't break App execution by ctrl+c | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | On Thursday, 27 April 2017 at 12:25:11 UTC, Adam D. Ruppe wrote: > On Thursday, 27 April 2017 at 12:17:12 UTC, Suliman wrote: >> Before my code handle empty result in `catch` block. > > You must be catching the ctrl+c exception... don't do that. Just catch the empty result exception. The issue is gone after removing http://code.dlang.org/packages/consoled it's look like that it's produced error. Now ctrl+c is woking fine... |
April 27, 2017 Re: Can't break App execution by ctrl+c | ||||
---|---|---|---|---|
| ||||
Posted in reply to Suliman | >Just catch the empty result exception.
I do not want to go to catch block if I have empty result. I just want to get there if any other error type occur. If result is empty that simply skip this step.
|
Copyright © 1999-2021 by the D Language Foundation