OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
error.c File Reference

Error messages. More...

#include <string.h>
#include "consts.h"
#include "error.h"
#include "error.txt"
Include dependency graph for error.c:

Macros

#define _CRT_SECURE_NO_DEPRECATE
 
#define ERR(code, string)
 

Functions

char * error_getMsg (int errCode, char *msg)
 Copy the catalog message for an error code into caller storage.
 
int error_setInpError (int errcode, char *s)
 Set the shared input-error token and pass through its code.
 

Variables

char ErrString [MAXMSG]
 

Detailed Description

Error messages.

Author
L. Rossman
Date
Created: 2021-11-01
Last updated: 2024-12-30
Version
5.3.0

Error codes used in the SWMM model.

Update History

  • Build 5.1.008:
    • Text of Error 217 for control rules modified.
  • Build 5.1.010:
    • Text of Error 318 for rainfall data files modified.
  • Build 5.1.015:
    • Added new Error 140 for storage nodes.
  • Build 5.2.0:
    • Re-designed error message system.

- Added new Error 235 for invalid infiltration parameters.

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com (OpenSWMM maintenance and extensions)
License
Apache-2.0 for OpenSWMM contributions; original EPA SWMM provenance is retained.

Macro Definition Documentation

◆ _CRT_SECURE_NO_DEPRECATE

#define _CRT_SECURE_NO_DEPRECATE

◆ ERR

#define ERR ( code,
string )
Value:
case code: \
strcpy(msg, string); \
break;

Function Documentation

◆ error_getMsg()

char * error_getMsg ( int errCode,
char * msg )

Copy the catalog message for an error code into caller storage.

Get the error message for a given error code.

Implementation arguments
  • errCode (in): Catalog error code; unknown codes select an empty string.
  • msg (out): Non-null caller-owned buffer with at least MAXMSG bytes, and enough room for the selected catalog message plus terminator.
Returns
The same borrowed msg pointer; it is not retained or allocated.
Here is the caller graph for this function:

◆ error_setInpError()

int error_setInpError ( int errcode,
char * s )

Set the shared input-error token and pass through its code.

Set an error code in the error manager.

Implementation arguments
  • errcode (in): Input error code to return unchanged.
  • s (in): Non-null borrowed null-terminated diagnostic token that fits in ErrString, including its terminator; copied with unbounded strcpy.
Returns
errcode. The global ErrString is overwritten; ErrorCode itself is not set here.
Here is the caller graph for this function:

Variable Documentation

◆ ErrString

char ErrString[MAXMSG]