For permission errors, a SecurityException occurs. For input errors, an IllegalArgumentException or an NullPointerException occurs. For most other errors, an IllegalStateException occurs. The message text for many of the exceptions contains an Teracloud Streams message with an identifier prefix. To handle specific Teracloud Streams messages in your application, you can add code to check whether the exception begins with a specific message identifier, then run the appropriate error handling code.