MSIR.0977: Difference between revisions

From m204wiki
Jump to navigation Jump to search
No edit summary
m (add <var>'s, etc.)
Line 2: Line 2:
<!--Test SOUL.DNC.005.QA in QASHR exercises at least some MSIR.0977 cases. PDS-6626 -->
<!--Test SOUL.DNC.005.QA in QASHR exercises at least some MSIR.0977 cases. PDS-6626 -->
<p>
<p>
A [[Exceptions#Using_the_Throw_statement|Throw]] statement or block was coded in an invalid context. The following examples are among the texts that might be displayed with this message:  
A <var>[[Exceptions#Using the Throw statement|Throw]]</var> statement or block was coded in an invalid context. The following examples are among the texts that might be displayed with this message:  
</p>
</p>
<ul>
<ul>
<li>The target of the Throw statement isn't an instance of an exception class, in which case the following message is produced:
<li>The target of the <var>Throw</var> statement is not an instance of an exception class, in which case the following message is produced:
<p class="code>MSIR.0977: THROW invalid -- value not an object</p>  
<p class="code>MSIR.0977: THROW invalid -- value not an object</p>  
</li>
</li>
<li>The target of the Throw statement is an instance of a class other than an exception class, in which case the following message is produced:
<li>The target of the <var>Throw</var> statement is an instance of a class other than an exception class, in which case the following message is produced:
<p class="code>MSIR.0977: THROW invalid -- object not in an exception class</p>  
<p class="code>MSIR.0977: THROW invalid -- object not in an exception class</p>  
</li>
</li>
<li>The Throw statement doesn't not appear within a valid class method, in which case the following message is produced:
<li>The <var>Throw</var> statement does not not appear within a valid class method, in which case the following message is produced:
<p class="code>MSIR.0977: THROW invalid -- not in a method</p>  
<p class="code>MSIR.0977: THROW invalid -- not in a method</p>  
</li>
</li>
<li>A Throw statement appears within the body of a method, but the method declaration doesn't include a Throws clause. In this case the following message is produced:
<li>A <var>Throw</var> statement appears within the body of a method, but the method declaration does not include a <var>Throws</var> clause. In this case the following message is produced:
<p class="code>MSIR.0977: THROW invalid -- method definition has no Throws clause</p>  
<p class="code>MSIR.0977: THROW invalid -- method definition has no Throws clause</p>  
</li>
</li>
<li>A Throw statement species a valid exception class object, but not of an exception class type that is defined in the Throws clause to the calling method. In this case the following message is produced:
<li>A <var>Throw</var> statement specifies a valid exception class object, but the object's class does not match any class that is defined in the <var>Throws</var> clause of the calling method. In this case the following message is produced:
<p class="code>MSIR.0977: THROW invalid -- object not of a thrown class</p>
<p class="code>MSIR.0977: THROW invalid -- object not of a thrown class</p>
</li>
</li>
</ul>
</ul>
<p>
 
<b>Response:</b>
</p>
{{Template:MSIR.0977 footer}}
{{Template:MSIR.0977 footer}}

Revision as of 15:32, 20 June 2018

MSIR.0977  THROW invalid -- token

A Throw statement or block was coded in an invalid context. The following examples are among the texts that might be displayed with this message:

  • The target of the Throw statement is not an instance of an exception class, in which case the following message is produced:

    MSIR.0977: THROW invalid -- value not an object

  • The target of the Throw statement is an instance of a class other than an exception class, in which case the following message is produced:

    MSIR.0977: THROW invalid -- object not in an exception class

  • The Throw statement does not not appear within a valid class method, in which case the following message is produced:

    MSIR.0977: THROW invalid -- not in a method

  • A Throw statement appears within the body of a method, but the method declaration does not include a Throws clause. In this case the following message is produced:

    MSIR.0977: THROW invalid -- method definition has no Throws clause

  • A Throw statement specifies a valid exception class object, but the object's class does not match any class that is defined in the Throws clause of the calling method. In this case the following message is produced:

    MSIR.0977: THROW invalid -- object not of a thrown class


Message attributes:

RETCODEO=0Sets online return code
RETCODEB=4Sets batch (single user) return code
CLASS=EError class; the message can be suppressed with the X'04' bit setting of the MSGCTL parameter
AUDITERWrites the message with line type ER to the audit trail
COUNTIncrements the error count (ERCNT) parameter
ECHODisplays the line that caused the error

Back to list of messages