
net.rdrei.android.buildtimetracker.reporters.ReporterConfigurationError.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gradle-plugin Show documentation
Show all versions of gradle-plugin Show documentation
Gradle plugin which tracks your build times.
The newest version!
package net.rdrei.android.buildtimetracker.reporters
class ReporterConfigurationError extends Exception {
String reporterName
String optionName
ErrorType errorType
String details
static enum ErrorType {
REQUIRED,
INVALID,
OTHER
}
ReporterConfigurationError(ErrorType errorType, String reporterName, String optionName) {
this(errorType, reporterName, optionName, null)
}
ReporterConfigurationError(ErrorType errorType, String reporterName, String optionName,
String details) {
super(generateMessage(errorType, reporterName, optionName, details))
this.reporterName = reporterName
this.optionName = optionName
this.errorType = errorType
this.details = details
}
static String generateMessage(ErrorType errorType, String reporterName, String optionName,
String details) {
def msg
switch (errorType) {
case ErrorType.REQUIRED:
msg = "$reporterName requires option $optionName to be set"
if (details != null) msg += ": $details"
break
case ErrorType.INVALID:
msg = "Option $optionName set for $reporterName is invalid"
if (details != null) msg += ": $details"
break
default:
msg = details ?: "Unknown error. Well, fuck."
}
msg
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy