Skip to content
Snippets Groups Projects
Commit 6ac606a5 authored by Josh Brooks's avatar Josh Brooks
Browse files

Add better error statements

parent ee96847e
No related branches found
No related tags found
No related merge requests found
...@@ -54,7 +54,8 @@ func check(session *storage.Session, ourId *id.ID, stop *stoppable.Single) { ...@@ -54,7 +54,8 @@ func check(session *storage.Session, ourId *id.ID, stop *stoppable.Single) {
now := time.Now() now := time.Now()
protoIds, err := getUpcomingIDs(ourId, now, lastCheck) protoIds, err := getUpcomingIDs(ourId, now, lastCheck)
if err != nil { if err != nil {
globals.Log.FATAL.Panicf("Could not generate : %v", err) globals.Log.FATAL.Panicf("Could not generate " +
"upcoming IDs: %v", err)
} }
// Generate identities off of that list // Generate identities off of that list
...@@ -66,7 +67,8 @@ func check(session *storage.Session, ourId *id.ID, stop *stoppable.Single) { ...@@ -66,7 +67,8 @@ func check(session *storage.Session, ourId *id.ID, stop *stoppable.Single) {
if !identityStore.IsNewIdentity(identity) { if !identityStore.IsNewIdentity(identity) {
// If not not, insert identity into store // If not not, insert identity into store
if err = identityStore.InsertIdentity(identity); err != nil { if err = identityStore.InsertIdentity(identity); err != nil {
return globals.Log.FATAL.Panicf("Could not insert " +
"identity: %v", err)
} }
} }
...@@ -75,12 +77,14 @@ func check(session *storage.Session, ourId *id.ID, stop *stoppable.Single) { ...@@ -75,12 +77,14 @@ func check(session *storage.Session, ourId *id.ID, stop *stoppable.Single) {
// Generate the time stamp for storage // Generate the time stamp for storage
vo, err := marshalTimestamp(now) vo, err := marshalTimestamp(now)
if err != nil { if err != nil {
return globals.Log.FATAL.Panicf("Could not marshal " +
"timestamp for storage: %v", err)
} }
// Store the timestamp // Store the timestamp
if err = session.Set(TimestampKey, vo); err != nil { if err = session.Set(TimestampKey, vo); err != nil {
return globals.Log.FATAL.Panicf("Could not store timestamp: %v", err)
} }
// Sleep until the last Id has expired // Sleep until the last Id has expired
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment