Improved warnings.
This commit is contained in:
parent
7afb62f44a
commit
345b755e6f
1 changed files with 4 additions and 11 deletions
|
@ -35,13 +35,6 @@ import com.beust.kobalt.misc.warn
|
||||||
import java.text.*
|
import java.text.*
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
/**
|
|
||||||
* The <code>Utils</code> class.
|
|
||||||
*
|
|
||||||
* @author <a href="mailto:erik@thauvin.net" target="_blank">Erik C. Thauvin</a>
|
|
||||||
* @created 2017-04-18
|
|
||||||
* @since 1.0
|
|
||||||
*/
|
|
||||||
class Utils {
|
class Utils {
|
||||||
companion object {
|
companion object {
|
||||||
private val calendarFields = mapOf(
|
private val calendarFields = mapOf(
|
||||||
|
@ -68,7 +61,7 @@ class Utils {
|
||||||
try {
|
try {
|
||||||
cal.time = fmt.parse(value)
|
cal.time = fmt.parse(value)
|
||||||
} catch (pe: ParseException) {
|
} catch (pe: ParseException) {
|
||||||
warn("Date parse exception for: ${entry.key}", pe)
|
warn("Date parse exception for: ${entry.key} --> ${pe.message}", pe)
|
||||||
success = false
|
success = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -82,7 +75,7 @@ class Utils {
|
||||||
offset *= -1
|
offset *= -1
|
||||||
}
|
}
|
||||||
} catch (nfe: NumberFormatException) {
|
} catch (nfe: NumberFormatException) {
|
||||||
warn("Non-integer value for: ${entry.key}")
|
warn("Non-integer value for: ${entry.key} --> ${nfe.message}", nfe)
|
||||||
success = false
|
success = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,10 +110,10 @@ class Utils {
|
||||||
|
|
||||||
p.setProperty(entry.key, fmt.format(intValue))
|
p.setProperty(entry.key, fmt.format(intValue))
|
||||||
} catch (nfe: NumberFormatException) {
|
} catch (nfe: NumberFormatException) {
|
||||||
warn("Number format exception for: ${entry.key}", nfe)
|
warn("Number format exception for: ${entry.key} --> ${nfe.message}", nfe)
|
||||||
success = false
|
success = false
|
||||||
} catch (pe: ParseException) {
|
} catch (pe: ParseException) {
|
||||||
warn("Number parsing exception for: ${entry.key}", pe)
|
warn("Number parsing exception for: ${entry.key} --> ${pe.message}", pe)
|
||||||
success = false
|
success = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue