Change error description: memory allocation error

This commit is contained in:
Shahram Najm 2016-12-15 11:51:47 +00:00
parent 2bd72b8dad
commit 53e5d46ba1
8 changed files with 10 additions and 8 deletions

View File

@ -74,6 +74,7 @@ while (<>) {
$name = 'InvalidOrderByError' if ($name eq 'InvalidOrderbyError'); $name = 'InvalidOrderByError' if ($name eq 'InvalidOrderbyError');
$name = 'InvalidBitsPerValueError' if ($name eq 'InvalidBpvError'); $name = 'InvalidBitsPerValueError' if ($name eq 'InvalidBpvError');
$name = 'KeyValueNotFoundError' if ($name eq 'NotFoundError'); $name = 'KeyValueNotFoundError' if ($name eq 'NotFoundError');
$name = 'MemoryAllocationError' if ($name eq 'OutOfMemoryError');
# Print the class declaration # Print the class declaration
print "class ${name}(GribInternalError):\n"; print "class ${name}(GribInternalError):\n";

View File

@ -39,7 +39,7 @@ Error codes returned by the grib_api functions.
#define GRIB_NO_MORE_IN_SET -15 #define GRIB_NO_MORE_IN_SET -15
/** Problem with calculation of geographic attributes */ /** Problem with calculation of geographic attributes */
#define GRIB_GEOCALCULUS_PROBLEM -16 #define GRIB_GEOCALCULUS_PROBLEM -16
/** Out of memory */ /** Memory allocation error */
#define GRIB_OUT_OF_MEMORY -17 #define GRIB_OUT_OF_MEMORY -17
/** Value is read only */ /** Value is read only */
#define GRIB_READ_ONLY -18 #define GRIB_READ_ONLY -18

View File

@ -123,8 +123,8 @@ class InvalidArgumentError(GribInternalError):
"""Invalid argument.""" """Invalid argument."""
class ReadOnlyError(GribInternalError): class ReadOnlyError(GribInternalError):
"""Value is read only.""" """Value is read only."""
class OutOfMemoryError(GribInternalError): class MemoryAllocationError(GribInternalError):
"""Out of memory.""" """Memory allocation error."""
class GeocalculusError(GribInternalError): class GeocalculusError(GribInternalError):
"""Problem with calculation of geographic attributes.""" """Problem with calculation of geographic attributes."""
class NoMoreInSetError(GribInternalError): class NoMoreInSetError(GribInternalError):
@ -208,7 +208,7 @@ ERROR_MAP = {
-20 : NullHandleError, -20 : NullHandleError,
-19 : InvalidArgumentError, -19 : InvalidArgumentError,
-18 : ReadOnlyError, -18 : ReadOnlyError,
-17 : OutOfMemoryError, -17 : MemoryAllocationError,
-16 : GeocalculusError, -16 : GeocalculusError,
-15 : NoMoreInSetError, -15 : NoMoreInSetError,
-14 : EncodingError, -14 : EncodingError,

View File

@ -1280,7 +1280,7 @@ Error codes returned by the eccodes functions.
#define CODES_NO_MORE_IN_SET GRIB_NO_MORE_IN_SET #define CODES_NO_MORE_IN_SET GRIB_NO_MORE_IN_SET
/** Problem with calculation of geographic attributes */ /** Problem with calculation of geographic attributes */
#define CODES_GEOCALCULUS_PROBLEM GRIB_GEOCALCULUS_PROBLEM #define CODES_GEOCALCULUS_PROBLEM GRIB_GEOCALCULUS_PROBLEM
/** Out of memory */ /** Memory allocation error */
#define CODES_OUT_OF_MEMORY GRIB_OUT_OF_MEMORY #define CODES_OUT_OF_MEMORY GRIB_OUT_OF_MEMORY
/** Value is read only */ /** Value is read only */
#define CODES_READ_ONLY GRIB_READ_ONLY #define CODES_READ_ONLY GRIB_READ_ONLY

View File

@ -81,6 +81,7 @@ END_HEADER
$name = 'InvalidOrderByError' if ($name eq 'InvalidOrderbyError'); $name = 'InvalidOrderByError' if ($name eq 'InvalidOrderbyError');
$name = 'InvalidBitsPerValueError' if ($name eq 'InvalidBpvError'); $name = 'InvalidBitsPerValueError' if ($name eq 'InvalidBpvError');
$name = 'KeyValueNotFoundError' if ($name eq 'NotFoundError'); $name = 'KeyValueNotFoundError' if ($name eq 'NotFoundError');
$name = 'MemoryAllocationError' if ($name eq 'OutOfMemoryError');
if ($code != 0) { # Ignore SUCCESS if ($code != 0) { # Ignore SUCCESS
print H "class ${name}(GribInternalError):\n"; ## $name,$_; print H "class ${name}(GribInternalError):\n"; ## $name,$_;

View File

@ -1576,7 +1576,7 @@ Error codes returned by the grib_api functions.
#define GRIB_NO_MORE_IN_SET -15 #define GRIB_NO_MORE_IN_SET -15
/** Problem with calculation of geographic attributes */ /** Problem with calculation of geographic attributes */
#define GRIB_GEOCALCULUS_PROBLEM -16 #define GRIB_GEOCALCULUS_PROBLEM -16
/** Out of memory */ /** Memory allocation error */
#define GRIB_OUT_OF_MEMORY -17 #define GRIB_OUT_OF_MEMORY -17
/** Value is read only */ /** Value is read only */
#define GRIB_READ_ONLY -18 #define GRIB_READ_ONLY -18

View File

@ -20,7 +20,7 @@ static const char *errors[] = {
"Encoding invalid", /* -14 GRIB_ENCODING_ERROR */ "Encoding invalid", /* -14 GRIB_ENCODING_ERROR */
"Code cannot unpack because of string too small", /* -15 GRIB_NO_MORE_IN_SET */ "Code cannot unpack because of string too small", /* -15 GRIB_NO_MORE_IN_SET */
"Problem with calculation of geographic attributes", /* -16 GRIB_GEOCALCULUS_PROBLEM */ "Problem with calculation of geographic attributes", /* -16 GRIB_GEOCALCULUS_PROBLEM */
"Out of memory", /* -17 GRIB_OUT_OF_MEMORY */ "Memory allocation error", /* -17 GRIB_OUT_OF_MEMORY */
"Value is read only", /* -18 GRIB_READ_ONLY */ "Value is read only", /* -18 GRIB_READ_ONLY */
"Invalid argument", /* -19 GRIB_INVALID_ARGUMENT */ "Invalid argument", /* -19 GRIB_INVALID_ARGUMENT */
"Null handle", /* -20 GRIB_NULL_HANDLE */ "Null handle", /* -20 GRIB_NULL_HANDLE */

View File

@ -17,7 +17,7 @@ GRIB_DECODING_ERROR Decoding invalid
GRIB_ENCODING_ERROR Encoding invalid GRIB_ENCODING_ERROR Encoding invalid
GRIB_NO_MORE_IN_SET Code cannot unpack because of string too small GRIB_NO_MORE_IN_SET Code cannot unpack because of string too small
GRIB_GEOCALCULUS_PROBLEM Problem with calculation of geographic attributes GRIB_GEOCALCULUS_PROBLEM Problem with calculation of geographic attributes
GRIB_OUT_OF_MEMORY Out of memory GRIB_OUT_OF_MEMORY Memory allocation error
GRIB_READ_ONLY Value is read only GRIB_READ_ONLY Value is read only
GRIB_INVALID_ARGUMENT Invalid argument GRIB_INVALID_ARGUMENT Invalid argument
GRIB_NULL_HANDLE Null handle GRIB_NULL_HANDLE Null handle