Package functions

Class MeosErrorHandler

java.lang.Object
functions.MeosErrorHandler
All Implemented Interfaces:
error_handler_fn

public class MeosErrorHandler extends Object implements error_handler_fn
  • Field Details

    • logger

      private static final org.slf4j.Logger logger
    • NOTICE

      public static final int NOTICE
      See Also:
    • WARNING

      public static final int WARNING
      See Also:
    • ERROR

      public static final int ERROR
      See Also:
    • MEOS_ERR_INTERNAL_ERROR

      public static final int MEOS_ERR_INTERNAL_ERROR
      See Also:
    • MEOS_ERR_INTERNAL_TYPE_ERROR

      public static final int MEOS_ERR_INTERNAL_TYPE_ERROR
      See Also:
    • MEOS_ERR_VALUE_OUT_OF_RANGE

      public static final int MEOS_ERR_VALUE_OUT_OF_RANGE
      See Also:
    • MEOS_ERR_DIVISION_BY_ZERO

      public static final int MEOS_ERR_DIVISION_BY_ZERO
      See Also:
    • MEOS_ERR_MEMORY_ALLOC_ERROR

      public static final int MEOS_ERR_MEMORY_ALLOC_ERROR
      See Also:
    • MEOS_ERR_AGGREGATION_ERROR

      public static final int MEOS_ERR_AGGREGATION_ERROR
      See Also:
    • MEOS_ERR_DIRECTORY_ERROR

      public static final int MEOS_ERR_DIRECTORY_ERROR
      See Also:
    • MEOS_ERR_FILE_ERROR

      public static final int MEOS_ERR_FILE_ERROR
      See Also:
    • MEOS_ERR_INVALID_ARG

      public static final int MEOS_ERR_INVALID_ARG
      See Also:
    • MEOS_ERR_INVALID_ARG_TYPE

      public static final int MEOS_ERR_INVALID_ARG_TYPE
      See Also:
    • MEOS_ERR_INVALID_ARG_VALUE

      public static final int MEOS_ERR_INVALID_ARG_VALUE
      See Also:
    • MEOS_ERR_FEATURE_NOT_SUPPORTED

      public static final int MEOS_ERR_FEATURE_NOT_SUPPORTED
      See Also:
    • MEOS_ERR_MFJSON_INPUT

      public static final int MEOS_ERR_MFJSON_INPUT
      See Also:
    • MEOS_ERR_MFJSON_OUTPUT

      public static final int MEOS_ERR_MFJSON_OUTPUT
      See Also:
    • MEOS_ERR_TEXT_INPUT

      public static final int MEOS_ERR_TEXT_INPUT
      See Also:
    • MEOS_ERR_TEXT_OUTPUT

      public static final int MEOS_ERR_TEXT_OUTPUT
      See Also:
    • MEOS_ERR_WKB_INPUT

      public static final int MEOS_ERR_WKB_INPUT
      See Also:
    • MEOS_ERR_WKB_OUTPUT

      public static final int MEOS_ERR_WKB_OUTPUT
      See Also:
    • MEOS_ERR_GEOJSON_INPUT

      public static final int MEOS_ERR_GEOJSON_INPUT
      See Also:
    • MEOS_ERR_GEOJSON_OUTPUT

      public static final int MEOS_ERR_GEOJSON_OUTPUT
      See Also:
    • EXCEPTION_MAP

      private static final Map<Integer,BiFunction<String,Integer,MeosException>> EXCEPTION_MAP
    • LAST_ERROR

      private static final ThreadLocal<int[]> LAST_ERROR
      The last error MEOS reported to the calling thread, as {code, level}.

      MEOS raises an error on the thread that made the call and keeps its own error number in thread-local storage, so this mirror is per-thread too. One slot shared across threads lets a thread consume or clear an error raised on another, which loses the exception its caller was owed and hands it to whichever thread asks next.

    • LAST_MESSAGE

      private static final ThreadLocal<String> LAST_MESSAGE
  • Constructor Details

    • MeosErrorHandler

      public MeosErrorHandler()
  • Method Details

    • apply

      public void apply(int errorLevel, int errorCode, String errorMessage)
      Specified by:
      apply in interface error_handler_fn
    • reportMeosException

      private static void reportMeosException(int level, int code, String message)
    • checkError

      public static void checkError()