Quit whitout arguments

CachéQuality release 
1.3.0
Id 
OS0082
Rule type 
Severity 

Critical

Critical
SQALE characteristic 
  • Reliability
    • Data
Tags 
runtime-failure
Remediation function 
Constant/issue
Remediation cost 
20min

Method is defined with ReturnType value but has QUIT or RETURN without arguments.

Noncompliant Code Example

Following code will compile, but on runtime the bar method will fail with "COMMAND error" message.

ClassMethod foo() As %String
{
    Quit
}

ClassMethod bar()
{
    #Dim str As %String = ..foo()
}

Compliant Solution

ClassMethod foo() As %String
{
    Quit "Hello"
}

ClassMethod bar()
{
    #Dim str As %String = ..foo()
}