# Creating Custom Business Component Exception Classes

You can use Business Component for Java exception classes in your own code to indicate errors, and you can create custom exception classes. For example, you can extend `JboException` and override the `getProductCode` method, making it return values appropriate for your exception.

You can throw a `JboException` by using a statement like this:

    throw new JboException("Don't do that.", "101", null );

The drawback to this approach is that the hard-coded error message is not easy to localize.