64 lines
No EOL
1.7 KiB
HTML
64 lines
No EOL
1.7 KiB
HTML
<html>
|
|
<title>Smart Script Class - Error Handling</title>
|
|
<body>
|
|
<h1><a name="Error"></a>Error Handling</h1>
|
|
<br>
|
|
<a href="#abort">abort</a>
|
|
<br>
|
|
<a href="#noData">noData</a>
|
|
<br>
|
|
<a href="#cancel">cancel</a>
|
|
<br>
|
|
<a href="#errorReturn">errorReturn</a>
|
|
<br>
|
|
<a href="#statusBarMsg">statusBarMsg</a>
|
|
<!-- Leave this comment for formatting purposes -->
|
|
<hr width="100%">
|
|
|
|
|
|
|
|
<h2>
|
|
<a name="abort"></a>abort</h2>
|
|
def abort(self, info):
|
|
<br>
|
|
# This call will send the info to
|
|
AlertViz,
|
|
<br>
|
|
# put up a dialog with the given info,
|
|
and abort the
|
|
<br>
|
|
# smart tool or procedure.
|
|
<br>
|
|
# Example:
|
|
<br>
|
|
# self.abort("Error processing my tool")
|
|
<br>
|
|
#
|
|
<h2><a name="noData"></a>noData</h2>
|
|
def noData(self, info="Insufficient Data to run Tool"):
|
|
<br>
|
|
#Raise the NoData exception error
|
|
<h2><a name="cancel"></a>cancel</h2>
|
|
def cancel(self):
|
|
<br>
|
|
# Cancels a smart tool without
|
|
displaying
|
|
an error message
|
|
<h2><a name="errorReturn"></a>errorReturn</h2>
|
|
def errorReturn(self, noDataError, message):
|
|
<h2><a name="statusBarMsg"></a>statusBarMsg</h2>
|
|
def statusBarMsg(self, message, status, category="GFE"):
|
|
<br>
|
|
# Sends the text message to AlertViz
|
|
with the
|
|
<br>
|
|
# given status code: "R" (regular),
|
|
"S" (significant), or "U" (urgent)
|
|
<br>
|
|
# Example:
|
|
<br>
|
|
# self.statusBarMsg("Running Smart
|
|
Tool",
|
|
"R")
|
|
<br>
|
|
# |