From c2c53f83d52faad8098353c9014b96731450d5ce Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Thu, 6 Jul 2017 00:01:56 +0200 Subject: [PATCH 1/3] Fixed bug with handling redis errors --- common/redis-cli-monitor.spec | 5 ++++- redis-cli-monitor.go | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/common/redis-cli-monitor.spec b/common/redis-cli-monitor.spec index 1f23b93..5126042 100644 --- a/common/redis-cli-monitor.spec +++ b/common/redis-cli-monitor.spec @@ -10,7 +10,7 @@ Summary: Tiny Redis client for renamed MONITOR commands Name: redis-cli-monitor -Version: 2.0.0 +Version: 2.0.1 Release: 0%{?dist} Group: Applications/System License: EKOL @@ -57,6 +57,9 @@ rm -rf %{buildroot} ############################################################################### %changelog +* Thu Jul 06 2017 Anton Novojilov - 2.0.1-0 +- Fixed bug with handling redis errors + * Sun Jul 02 2017 Anton Novojilov - 2.0.0-0 - Added colors and timestamp formatting - Added option for enabling raw output diff --git a/redis-cli-monitor.go b/redis-cli-monitor.go index 5c65b5e..b192c3c 100644 --- a/redis-cli-monitor.go +++ b/redis-cli-monitor.go @@ -28,7 +28,7 @@ import ( const ( APP = "Redis CLI Monitor" - VER = "2.0.0" + VER = "2.0.1" DESC = "Tiny Redis client for renamed MONITOR commands" ) @@ -157,6 +157,10 @@ func monitor(cmd string) { continue } + if strings.HasPrefix(str, "-ERR ") { + printErrorAndExit("Redis return error message: " + strings.TrimRight(str[1:], "\r\n")) + } + if useRawOutput { fmt.Printf("%s", str[1:]) } else { From 36aa2a17ec25629b0281978c17f3fda423b5c9ee Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Thu, 6 Jul 2017 01:27:50 +0200 Subject: [PATCH 2/3] Improved readme --- readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/readme.md b/readme.md index 69f86b6..dab83b6 100644 --- a/readme.md +++ b/readme.md @@ -75,10 +75,10 @@ Examples ### Build Status -| Repository | Status | +| Branch | Status | |------------|--------| -| Stable | [![Build Status](https://travis-ci.org/essentialkaos/redis-cli-monitor.svg?branch=master)](https://travis-ci.org/essentialkaos/redis-cli-monitor) | -| Unstable | [![Build Status](https://travis-ci.org/essentialkaos/redis-cli-monitor.svg?branch=develop)](https://travis-ci.org/essentialkaos/redis-cli-monitor) | +| `master` | [![Build Status](https://travis-ci.org/essentialkaos/redis-cli-monitor.svg?branch=master)](https://travis-ci.org/essentialkaos/redis-cli-monitor) | +| `develop` | [![Build Status](https://travis-ci.org/essentialkaos/redis-cli-monitor.svg?branch=develop)](https://travis-ci.org/essentialkaos/redis-cli-monitor) | ### License From 3921213bf6dd133b83f12d943668311cb1fb8587 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Thu, 6 Jul 2017 11:26:28 +0200 Subject: [PATCH 3/3] Improved readme --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index dab83b6..0a80a89 100644 --- a/readme.md +++ b/readme.md @@ -76,7 +76,7 @@ Examples ### Build Status | Branch | Status | -|------------|--------| +|--------|--------| | `master` | [![Build Status](https://travis-ci.org/essentialkaos/redis-cli-monitor.svg?branch=master)](https://travis-ci.org/essentialkaos/redis-cli-monitor) | | `develop` | [![Build Status](https://travis-ci.org/essentialkaos/redis-cli-monitor.svg?branch=develop)](https://travis-ci.org/essentialkaos/redis-cli-monitor) |