File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,6 +40,10 @@ interface PackageFile {
4040 path : string ;
4141}
4242
43+ function normalizeServerErrorMessage ( message : string ) : string {
44+ return message ? message . replace ( / c o d e - p u s h - s t a n d a l o n e / g, "code-push" ) : message ;
45+ }
46+
4347// A template string tag function that URL encodes the substituted values
4448function urlEncode ( strings : string [ ] , ...values : string [ ] ) : string {
4549 let result = "" ;
@@ -526,12 +530,12 @@ class AccountManager {
526530 } else {
527531 if ( body ) {
528532 reject ( < CodePushError > {
529- message : body . message ,
533+ message : normalizeServerErrorMessage ( body . message ) ,
530534 statusCode : this . getErrorStatus ( err , res ) ,
531535 } ) ;
532536 } else {
533537 reject ( < CodePushError > {
534- message : res . text ,
538+ message : normalizeServerErrorMessage ( res . text ) ,
535539 statusCode : this . getErrorStatus ( err , res ) ,
536540 } ) ;
537541 }
@@ -556,7 +560,7 @@ class AccountManager {
556560 }
557561
558562 private getErrorMessage ( error : Error , response : superagent . Response ) : string {
559- return response && response . text ? response . text : error . message ;
563+ return normalizeServerErrorMessage ( response && response . text ? response . text : error . message ) ;
560564 }
561565
562566 private attachCredentials ( request : superagent . Request < any > ) : void {
You can’t perform that action at this time.
0 commit comments