From 09ea3282aff77d2dadf893c436e0a49198af96b0 Mon Sep 17 00:00:00 2001 From: Xavi Ramirez Date: Sun, 20 Aug 2017 23:42:27 +0000 Subject: [PATCH] Standardized error reporting --- kcl/kcl.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/kcl/kcl.go b/kcl/kcl.go index 913150e..b1d2d2e 100644 --- a/kcl/kcl.go +++ b/kcl/kcl.go @@ -5,7 +5,6 @@ import ( "encoding/json" "fmt" "io" - "os" "sync" "time" ) @@ -181,12 +180,12 @@ func (kclp *KCLProcess) handleCheckpointAction(action ActionCheckpoint) error { return fmt.Errorf("Encountered shutdown exception, skipping checkpoint") case "ThrottlingException": sleep := 5 * time.Second - fmt.Fprintf(os.Stderr, "Checkpointing throttling, pause for %s", sleep) + kclp.ioHandler.writeError(fmt.Sprintf("Checkpointing throttling, pause for %s", sleep)) time.Sleep(sleep) case "InvalidStateException": - fmt.Fprintf(os.Stderr, "MultiLangDaemon invalid state while checkpointing") + kclp.ioHandler.writeError("MultiLangDaemon invalid state while checkpointing") default: - fmt.Fprintf(os.Stderr, "Encountered an error while checkpointing: %s", msg) + kclp.ioHandler.writeError(fmt.Sprintf("Encountered an error while checkpointing: %s", msg)) } seq := action.SequenceNumber