Fj-java-error class, Methods that acquire exception information, Get-message method (object method) – FUJITSU J Adapter Class Generator User Manual

Page 50: Explanation, Syntax, Parameter and return value, Get-code method (object method)

Advertising
background image

50 Chapter 5. Adapter Class Reference

FJ-JAVA-ERROR class

The adapter class generates the exception object when some error is detected

during execution period. The FJ-JAVA-ERROR class is the class of that exception

object. The exception message, exception type and exception information of Java

can be acquired by using the FJ-JAVA-ERROR class method.
Refer to "Fujitsu NetCOBOL User's Guide" for details of the exception processing.
The FJ-JAVA-ERROR class has the following methods.

Methods that Acquire Exception Information

Method name

Type

Function

GET-MESSAGE

Object

Returns the exception message.

GET-CODE

Object

Returns the type of exception

GET-EXCEPTION Object Returns

the Java exception information.

GET-MESSAGE method (object method)

Explanation
Returns the exception message. It is used to indicate the error content.
Syntax
INVOKE EXCEPTION-OBJECT "GET-MESSAGE" USING

message

RETURNING

messageLength

Parameter and return value
• message (attribute: PIC X ANY LENGTH)

Specifies the data item that stores the exception message.

• messageLength (attribute: PIC S9(9) COMP-5)

Length (number of bytes) of the exception message is returned.

GET-CODE method (object method)

Explanation
Returns the type of exception.
Syntax
INVOKE EXCEPTION-OBJECT "GET-CODE" RETURNING

code

Parameter and return value
• code (attribute: PIC S9(9) COMP-5)

Type of exception is returned.

Advertising