properly handle more error messages.

from upstream git.
This commit is contained in:
dcoppa 2012-06-08 11:01:20 +00:00
parent 9b3435c62c
commit dcaa682854
3 changed files with 46 additions and 8 deletions

View File

@ -1,11 +1,11 @@
# $OpenBSD: Makefile,v 1.40 2012/05/28 09:47:00 dcoppa Exp $
# $OpenBSD: Makefile,v 1.41 2012/06/08 11:01:20 dcoppa Exp $
SHARED_ONLY = Yes
COMMENT = console client for pandora
DISTNAME = pianobar-2012.05.06
REVISION = 3
REVISION = 4
EXTRACT_SUFX = .tar.bz2
CATEGORIES = audio
@ -15,7 +15,7 @@ HOMEPAGE = http://6xq.net/projects/pianobar/
MASTER_SITES = ${HOMEPAGE} \
http://spacehopper.org/mirrors/
SHARED_LIBS = piano 1.2 # 0.0.0
SHARED_LIBS = piano 1.3 # 0.0.0
# MIT
PERMIT_PACKAGE_CDROM = Yes

View File

@ -1,11 +1,15 @@
$OpenBSD: patch-src_libpiano_piano_c,v 1.7 2012/05/28 09:47:00 dcoppa Exp $
$OpenBSD: patch-src_libpiano_piano_c,v 1.8 2012/06/08 11:01:20 dcoppa Exp $
Fix ambiguous error message "Invalid Partner Login" on wrong
email address/password failure
(upstream git commit 81bf363ac69e0036562434ca0e7153c3e624c8c3)
More error messages
(upstream git commit 2d9b7bfd3395148419da27cd3c98de470a2d245b
and commit b32348d88f700f4a3b5fb3a95f7ee40336952230)
--- src/libpiano/piano.c.orig Sun May 6 16:33:54 2012
+++ src/libpiano/piano.c Mon May 28 10:51:30 2012
+++ src/libpiano/piano.c Fri Jun 8 12:38:13 2012
@@ -250,6 +250,10 @@ const char *PianoErrorToStr (PianoReturn_t ret) {
return "Out of memory.";
break;
@ -17,3 +21,23 @@ email address/password failure
/* pandora error messages */
case PIANO_RET_P_INTERNAL:
return "Internal error.";
@@ -281,6 +285,19 @@ const char *PianoErrorToStr (PianoReturn_t ret) {
case PIANO_RET_P_INVALID_PARTNER_LOGIN:
return "Invalid partner login.";
+ break;
+
+ case PIANO_RET_P_LICENSING_RESTRICTIONS:
+ return "Pandora is not available in your country. "
+ "Set up a control proxy (see manpage).";
+ break;
+
+ case PIANO_RET_P_PARTNER_NOT_AUTHORIZED:
+ return "Invalid partner credentials.";
+ break;
+
+ case PIANO_RET_P_LISTENER_NOT_AUTHORIZED:
+ return "Listener not authorized.";
break;
default:

View File

@ -1,16 +1,30 @@
$OpenBSD: patch-src_libpiano_piano_h,v 1.3 2012/05/28 09:47:00 dcoppa Exp $
$OpenBSD: patch-src_libpiano_piano_h,v 1.4 2012/06/08 11:01:20 dcoppa Exp $
Fix ambiguous error message "Invalid Partner Login" on wrong
email address/password failure
(upstream git commit 81bf363ac69e0036562434ca0e7153c3e624c8c3)
More error messages
(upstream git commit b32348d88f700f4a3b5fb3a95f7ee40336952230)
--- src/libpiano/piano.h.orig Sun May 6 16:33:54 2012
+++ src/libpiano/piano.h Mon May 28 10:59:07 2012
@@ -244,6 +244,7 @@ typedef enum {
+++ src/libpiano/piano.h Fri Jun 8 12:38:08 2012
@@ -244,7 +244,9 @@ typedef enum {
PIANO_RET_INVALID_RESPONSE = 2,
PIANO_RET_CONTINUE_REQUEST = 3,
PIANO_RET_OUT_OF_MEMORY = 4,
+ PIANO_RET_INVALID_LOGIN = 5,
+ /* pandora error codes */
PIANO_RET_P_INTERNAL = PIANO_RET_OFFSET+0,
PIANO_RET_P_API_VERSION_NOT_SUPPORTED = PIANO_RET_OFFSET+11,
PIANO_RET_P_BIRTH_YEAR_INVALID = PIANO_RET_OFFSET+1025,
@@ -284,7 +286,7 @@ typedef enum {
PIANO_RET_P_URL_PARAM_MISSING_USER_ID = PIANO_RET_OFFSET+5,
PIANO_RET_P_USERNAME_ALREADY_EXISTS = PIANO_RET_OFFSET+1013,
PIANO_RET_P_USER_ALREADY_USED_TRIAL = PIANO_RET_OFFSET+1037,
- PIANO_RET_P_USER_NOT_ACTIVE = PIANO_RET_OFFSET+1003,
+ PIANO_RET_P_LISTENER_NOT_AUTHORIZED = PIANO_RET_OFFSET+1003,
PIANO_RET_P_USER_NOT_AUTHORIZED = PIANO_RET_OFFSET+1004,
PIANO_RET_P_ZIP_CODE_INVALID = PIANO_RET_OFFSET+1024,