[]
        
(Showing Draft Content)

JsonError

Class JsonError

java.lang.Object
com.grapecity.documents.excel.JsonError
Direct Known Subclasses:
DataValidationJsonError, FormulaJsonError

public abstract class JsonError extends Object
Represents the base type for JSON-related errors.

This abstract class provides the common error message information shared by JSON error objects in GcExcel. Concrete subclasses expose additional context for specific JSON processing problems, such as formula errors or data validation errors.

Use this type as a general reference when working with APIs that report JSON import or serialization issues, and use getErrorMessage() to retrieve the descriptive error text.


 JsonError error = new JsonError("Invalid formula") { };
 String message = error.getErrorMessage();
 
  • Constructor Details

    • JsonError

      public JsonError(String errorMessage)
      Constructor that creates a JsonError object with the specified error message.

      Initializes the error message returned by getErrorMessage().

      
       JsonError error = new JsonError("Invalid formula") { };
       String message = error.getErrorMessage();
       
      Parameters:
      errorMessage - The error message. This value can be null.
  • Method Details

    • getErrorMessage

      public String getErrorMessage()
      Gets the descriptive message for this JSON error.

      Use this method to retrieve the error text associated with a JSON import, deserialization, or serialization issue.

      
       JsonError error = new JsonError("Invalid formula") { };
       String message = error.getErrorMessage();
       
      Returns:
      The error message associated with this JSON error, or null if no message was provided when the error was created.