|
| 1 | +package com.contentstack.sdk; |
| 2 | + |
| 3 | +/** |
| 4 | + * Contains all error messages used across the SDK. |
| 5 | + * Centralizing messages here makes it easier to maintain and update them. |
| 6 | + */ |
| 7 | +public final class ErrorMessages { |
| 8 | + private ErrorMessages() { |
| 9 | + throw new IllegalStateException("Utility class - do not instantiate"); |
| 10 | + } |
| 11 | + |
| 12 | + // Constructor related errors |
| 13 | + public static final String PRIVATE_CONSTRUCTOR_NOT_ALLOWED = |
| 14 | + "This class does not support private constructors. Use a public constructor to create an instance."; |
| 15 | + public static final String UTILITY_CLASS_INSTANTIATION = |
| 16 | + "This is a utility class and cannot be instantiated"; |
| 17 | + public static final String NODE_TO_HTML_INSTANTIATION = |
| 18 | + "Failed to create an instance of NodeToHTML, you can directly access the methods of this class"; |
| 19 | + |
| 20 | + // Input validation errors |
| 21 | + public static final String NULL_OR_EMPTY_INPUT = |
| 22 | + "The input value cannot be null or empty. Provide a valid string to continue."; |
| 23 | + |
| 24 | + // Network and parsing errors |
| 25 | + public static final String ENCODING_ERROR = |
| 26 | + "The system encountered an encoding issue while processing your request. Try again or contact support."; |
| 27 | + public static final String JSON_PARSING_ERROR = |
| 28 | + "We couldn't process the response due to a data formatting issue. Try again or contact support if the problem persists."; |
| 29 | + |
| 30 | + // Cache related errors |
| 31 | + public static final String CACHE_INITIALIZATION_ERROR = |
| 32 | + "Failed to initialize cache. The application will continue without caching."; |
| 33 | +} |
0 commit comments