Defining error codes

Define error codes of errors that occurs in grid generating program, and the messages that correspond to them. Error codes can be defined with ErrorCode elements in grid generating program definition file. Add definitions to the definition file you created, as shown in List 17. The added part is shown with highlight.

List 17 Example of grid generating program definition file that now has error codes
1
2
3
4
5
6
7
8
(abbr.)
      </Item>
    </Tab>
  </GridGeneratingCondition>
  <ErrorCodes>
    <ErrorCode value="1" caption="IMax * JMax must be smaller than 100,000." />
  </ErrorCodes>
</GridGeneratorDefinition>

At this Point, the structure of grid generating program definition file is as shown in Figure 35. The ErrorCodes element is not required.

../_images/gridgendef_structure_with_error.png

Figure 35 The grid generating program definition file structure

You can not check whether ErrorCode element is properly defined until you create a grid generating program. You are going to check it in Adding error handling codes.