exception

EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) on dispatch_semaphore_dispose

∥☆過路亽.° 提交于 2019-12-28 04:49:10
问题 I am getting EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) on dispatch_semaphore_dispose but don't really know how to track down the root cause of this. My code makes use of dispatch_async, dispatch_group_enter and so on. UPDATE: The cause of the crash is due to the fact that the webserviceCall (see code below) never calls onCompletion and when the code is run again, I got the error EXC_BAD_INSTRUCTION. I verified this is indeed the case, but not sure why or how to prevent this. Code

Breakpoint at exception in Eclipse - how to examine Exception object?

强颜欢笑 提交于 2019-12-28 04:01:09
问题 I feel like I'm missing something very simple here. I have Eclipse set up to break on all exceptions. So, let's say that it breaks on an AssertationFailedException. The Debug window will show that thread suspended and has the following data: Thread [Thread-1] (Suspended (exception AssertionFailedException)) ContactManager.addContact(String) line: 93 ContactManager$ContactDataCallback.dispatch(String, Element, ClientConnector) line: 118 PacketHandler.handle(FractusPacket) line: 173

Business Objects, Validation And Exceptions

浪尽此生 提交于 2019-12-28 03:17:28
问题 I’ve been reading a few questions and answers regarding exceptions and their use. Seems to be a strong opinion that exceptions should be raised only for exception, unhandled cases. So that lead me to wondering how validation works with business objects. Lets say I have a business object with getters/setters for the properties on the object. Let’s say I need to validate that the value is between 10 and 20. This is a business rule so it belongs in my business object. So that seems to imply to

GDB complaining about missing raise.c

梦想的初衷 提交于 2019-12-28 02:58:25
问题 I'm getting an an annoying error every time gdb catches an exception. I've run the following example program #include <stdexcept> int main() { throw std::invalid_argument(""); return 0; } And the result from running gdb is terminate called after throwing an instance of 'std::invalid_argument' what(): Program received signal SIGABRT, Aborted. __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51 51 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory. It's not all that

javax.crypto.BadPaddingException

心不动则不痛 提交于 2019-12-28 02:35:07
问题 I am working on AES algorithm, and I have this exception which I couldn't solve. javax.crypto.BadPaddingException: Given final block not properly padded at com.sun.crypto.provider.SunJCE_f.b(DashoA13*..) at com.sun.crypto.provider.SunJCE_f.b(DashoA13*..) at com.sun.crypto.provider.AESCipher.engineDoFinal(DashoA13*..) at javax.crypto.Cipher.doFinal(DashoA13*..) the exception happens in the decryption part. I initialize the key in a different place from where the decryption algorithm is

Why am I getting “must be caught or declared to be thrown” on my program?

白昼怎懂夜的黑 提交于 2019-12-28 02:07:31
问题 I have been working on this program for quite sometime and my brain is fried. I could use some help from someone looking in. I'm trying to make a program that reads a text file line by line and each line is made into an ArrayList so I can access each token. What am I doing wrong? import java.util.*; import java.util.ArrayList; import java.io.*; import java.rmi.server.UID; import java.util.concurrent.atomic.AtomicInteger; public class PCB { public void read (String [] args) { BufferedReader

Ignore Exception in C#

荒凉一梦 提交于 2019-12-28 01:27:12
问题 Is there a better way to ignore an exception in C# than putting it up in a try catch block and doing nothing in catch? I find this syntax to be cumbersome. For a codeblock, can't I simply "tag" it in such a way so as runtime knows which exceptions to neglect? 回答1: I don't think there is a trick to avoid exception but you can use the following code snippet: public void IgnoreExceptions(Action act) { try { act.Invoke(); } catch { } } Using the method looks like: IgnoreExceptions(() => foo());

Active Directory COM Exception - An operations error occurred (0x80072020)

心已入冬 提交于 2019-12-27 17:39:27
问题 I am getting an intermittent COM Exception " An operations error occurred (0x80072020) " (shown below) when I try and query Active Directory using the method GroupPrincipal.FindByIdentity Here is my code: PrincipalContext ctx = new PrincipalContext(ContextType.Domain, Environment.UserDomainName); GroupPrincipal groupPrincipal = GroupPrincipal.FindByIdentity(ctx, IdentityType.Name, "Group to find"); I am receiving Exception: Inner Exception: System.Runtime.InteropServices.COMException

Active Directory COM Exception - An operations error occurred (0x80072020)

青春壹個敷衍的年華 提交于 2019-12-27 17:39:02
问题 I am getting an intermittent COM Exception " An operations error occurred (0x80072020) " (shown below) when I try and query Active Directory using the method GroupPrincipal.FindByIdentity Here is my code: PrincipalContext ctx = new PrincipalContext(ContextType.Domain, Environment.UserDomainName); GroupPrincipal groupPrincipal = GroupPrincipal.FindByIdentity(ctx, IdentityType.Name, "Group to find"); I am receiving Exception: Inner Exception: System.Runtime.InteropServices.COMException

return eats exception

心已入冬 提交于 2019-12-27 17:37:18
问题 I found the following behavior at least weird : def errors(): try: ErrorErrorError finally: return 10 print errors() # prints: 10 # It should raise: NameError: name 'ErrorErrorError' is not defined The exception disappears when you use return inside a finally clause. Is that a bug? Is that documented anywhere? But the real question (and the answer I will mark as correct) is: What is the python developers' reason to allow that odd behavior? 回答1: You asked about the Python developers' reasoning