Skip to content

Commit bf7ad38

Browse files
committed
fix: avoid crash if for some reason the build time is unavailable
1 parent 1181af2 commit bf7ad38

File tree

1 file changed

+3
-2
lines changed
  • operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config

1 file changed

+3
-2
lines changed

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/Utils.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package io.javaoperatorsdk.operator.api.config;
22

33
import java.io.IOException;
4-
import java.text.ParseException;
54
import java.text.SimpleDateFormat;
65
import java.time.Instant;
76
import java.util.Date;
87
import java.util.Properties;
8+
99
import org.slf4j.Logger;
1010
import org.slf4j.LoggerFactory;
1111

@@ -41,7 +41,8 @@ public static Version loadFromProperties() {
4141
// RFC 822 date is the default format used by git-commit-id-plugin
4242
new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ")
4343
.parse(properties.getProperty("git.build.time"));
44-
} catch (ParseException e) {
44+
} catch (Exception e) {
45+
log.debug("Couldn't parse git.build.time property", e);
4546
builtTime = Date.from(Instant.EPOCH);
4647
}
4748
return new Version(

0 commit comments

Comments
 (0)