Package me.neznamy.tab.shared
Class ErrorManager
java.lang.Object
me.neznamy.tab.shared.ErrorManager
An error assistant to print internal errors into error file
and warn user about misconfiguration
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcriticalError(String message, Throwable t) Prints error message and stack trace into errors.log file as well as the consolefixAnimationFrames(String name, List<String> list) Returns the list if not null, empty list and error message if nullintfixAnimationInterval(String name, int interval) Makes interval divisible by 50 and sends error message if it was not already or was 0 or lessReturns anti-override.log filevoidmissingAttribute(String objectType, Object objectName, String attribute) Sends a startup warn about missing object parameterdoubleparseDouble(String string, double defaultValue) Parses double in given string and returns it.floatparseFloat(String string, float defaultValue) Parses float in given string and returns it.intparseInteger(String string, int defaultValue) Parses integer in given string and returns it.voidplaceholderError(String message, Throwable t) Prints error message thrown by placeholder and stack trace into placeholder-errors.log filevoidplaceholderError(String message, List<String> t) Prints error message thrown by placeholder and stack trace into placeholder-errors.log filevoidprintError(String message) Prints error message into errors.log filevoidprintError(String message, Throwable t) Prints error message and stack trace into errors.log filevoidprintError(String message, Throwable t, boolean intoConsoleToo) Prints error message and stack trace into errors.log filevoidprintError(String message, Throwable t, boolean intoConsoleToo, File file) Prints error message and stack trace into specified filevoidstartupWarn(String message) Sends a startup warn message into console
-
Constructor Details
-
ErrorManager
public ErrorManager()
-
-
Method Details
-
printError
Prints error message into errors.log file- Parameters:
message- message to print
-
printError
Prints error message and stack trace into errors.log file- Parameters:
message- message to printt- thrown error
-
printError
Prints error message and stack trace into errors.log file- Parameters:
message- message to printt- thrown errorintoConsoleToo- if the message should be printed into console as well or not
-
printError
Prints error message and stack trace into specified file- Parameters:
message- message to printt- thrown errorintoConsoleToo- if the message should be printed into console as well or notfile- file to print error to
-
placeholderError
Prints error message thrown by placeholder and stack trace into placeholder-errors.log file- Parameters:
message- message to printt- thrown error
-
placeholderError
Prints error message thrown by placeholder and stack trace into placeholder-errors.log file- Parameters:
message- message to printt- thrown stack trace elements
-
criticalError
Prints error message and stack trace into errors.log file as well as the console- Parameters:
message- message to printt- thrown error
-
parseInteger
Parses integer in given string and returns it. Returns second argument if string is not valid.- Parameters:
string- string to parsedefaultValue- value to return if string is not valid- Returns:
- parsed integer or
defaultValueif input is invalid
-
parseFloat
Parses float in given string and returns it. Returns second argument if string is not valid.- Parameters:
string- string to parsedefaultValue- value to return if string is not valid- Returns:
- parsed float or
defaultValueif input is invalid
-
parseDouble
Parses double in given string and returns it. Returns second argument if string is not valid.- Parameters:
string- string to parsedefaultValue- value to return if string is not valid- Returns:
- parsed float or
defaultValueif input is invalid
-
fixAnimationInterval
Makes interval divisible by 50 and sends error message if it was not already or was 0 or less- Parameters:
name- name of animation used in error messageinterval- configured change interval- Returns:
- fixed change interval
-
fixAnimationFrames
Returns the list if not null, empty list and error message if null- Parameters:
name- name of animation used in error messagelist- list of configured animation frames- Returns:
- the list if it's valid, singleton list with
"<Invalid Animation>"otherwise
-
startupWarn
Sends a startup warn message into console- Parameters:
message- message to print into console
-
missingAttribute
Sends a startup warn about missing object parameter- Parameters:
objectType- object type missing parameterobjectName- name of objectattribute- missing parameter
-
getAntiOverrideLog
Returns anti-override.log file- Returns:
- anti-override.log file
-