Fossil SCM
If the "fossil chat send" command fails, show an error message.
Commit
e514bb5b830945ded18a942dcbdb07f8c741840b58db9ecb77dbb116cc615694
Parent
62d67ed9a52e0fb…
1 file changed
+8
+8
| --- src/chat.c | ||
| +++ src/chat.c | ||
| @@ -820,10 +820,18 @@ | ||
| 820 | 820 | blob_appendf(&up,"\r\n%s", zBoundary); |
| 821 | 821 | } |
| 822 | 822 | blob_append(&up,"--\r\n", 4); |
| 823 | 823 | http_exchange(&up, &down, mFlags, 4, "multipart/form-data"); |
| 824 | 824 | blob_reset(&up); |
| 825 | + if( sqlite3_strglob("{\"isError\": true,*", blob_str(&down))==0 ){ | |
| 826 | + if( strstr(blob_str(&down), "not logged in")!=0 ){ | |
| 827 | + fossil_print("ERROR: username and/or password is incorrect\n"); | |
| 828 | + }else{ | |
| 829 | + fossil_print("ERROR: %s\n", blob_str(&down)); | |
| 830 | + } | |
| 831 | + fossil_fatal("unable to send the chat message"); | |
| 832 | + } | |
| 825 | 833 | blob_reset(&down); |
| 826 | 834 | }else if( strcmp(g.argv[2],"url")==0 ){ |
| 827 | 835 | /* Undocumented command. Show the URL to access chat. */ |
| 828 | 836 | fossil_print("%s/chat\n", zUrl); |
| 829 | 837 | }else{ |
| 830 | 838 |
| --- src/chat.c | |
| +++ src/chat.c | |
| @@ -820,10 +820,18 @@ | |
| 820 | blob_appendf(&up,"\r\n%s", zBoundary); |
| 821 | } |
| 822 | blob_append(&up,"--\r\n", 4); |
| 823 | http_exchange(&up, &down, mFlags, 4, "multipart/form-data"); |
| 824 | blob_reset(&up); |
| 825 | blob_reset(&down); |
| 826 | }else if( strcmp(g.argv[2],"url")==0 ){ |
| 827 | /* Undocumented command. Show the URL to access chat. */ |
| 828 | fossil_print("%s/chat\n", zUrl); |
| 829 | }else{ |
| 830 |
| --- src/chat.c | |
| +++ src/chat.c | |
| @@ -820,10 +820,18 @@ | |
| 820 | blob_appendf(&up,"\r\n%s", zBoundary); |
| 821 | } |
| 822 | blob_append(&up,"--\r\n", 4); |
| 823 | http_exchange(&up, &down, mFlags, 4, "multipart/form-data"); |
| 824 | blob_reset(&up); |
| 825 | if( sqlite3_strglob("{\"isError\": true,*", blob_str(&down))==0 ){ |
| 826 | if( strstr(blob_str(&down), "not logged in")!=0 ){ |
| 827 | fossil_print("ERROR: username and/or password is incorrect\n"); |
| 828 | }else{ |
| 829 | fossil_print("ERROR: %s\n", blob_str(&down)); |
| 830 | } |
| 831 | fossil_fatal("unable to send the chat message"); |
| 832 | } |
| 833 | blob_reset(&down); |
| 834 | }else if( strcmp(g.argv[2],"url")==0 ){ |
| 835 | /* Undocumented command. Show the URL to access chat. */ |
| 836 | fossil_print("%s/chat\n", zUrl); |
| 837 | }else{ |
| 838 |