Skip to content

Commit

Permalink
Backport fix for #646
Browse files Browse the repository at this point in the history
  • Loading branch information
David Dooling committed Feb 10, 2020
1 parent 3d386bf commit 9cb2f9e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 36 deletions.
27 changes: 9 additions & 18 deletions lib/operations/common/BitBucketRepoRef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,9 @@ export class BitBucketRepoRef extends AbstractRemoteRepoRef {
};
})
.catch(error => {
logger.error("Error attempting to create repository %j: %s", this, error);
return {
target: this,
success: false,
error,
};
error.message = `Error attempting to create repository ${JSON.stringify(this)}: ${error.message}`;
logger.error(error.message);
throw error;
});

}
Expand All @@ -84,12 +81,9 @@ export class BitBucketRepoRef extends AbstractRemoteRepoRef {
};
})
.catch(error => {
logger.error("Error attempting to delete repository: " + error);
return {
target: this,
success: false,
error,
};
error.message = `Error attempting to delete repository: ${error.message}`;
logger.error(error.message);
throw error;
});
}

Expand Down Expand Up @@ -134,12 +128,9 @@ export class BitBucketRepoRef extends AbstractRemoteRepoRef {
};
})
.catch(error => {
logger.error(`Error attempting to raise PR. ${url} ${error}`);
return {
target: this,
success: false,
error,
};
error.message = `Error attempting to raise PR ${url}: ${error}`;
logger.error(error.message);
throw error;
});
}
}
Expand Down
27 changes: 9 additions & 18 deletions lib/operations/common/BitBucketServerRepoRef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,9 @@ export class BitBucketServerRepoRef extends AbstractRemoteRepoRef {
response,
}))
.catch(error => {
logger.error("Error attempting to create repository %j: %s", this, error);
return {
success: false,
target: this,
error,
};
error.message = `Error attempting to create repository ${JSON.stringify(this)}}: ${error.message}`;
logger.error(error.message);
throw error;
});
}

Expand All @@ -96,12 +93,9 @@ export class BitBucketServerRepoRef extends AbstractRemoteRepoRef {
response,
}))
.catch(error => {
logger.error(`Error attempting to delete repository: ${error}`);
return {
success: false,
target: this,
error,
};
error.message = `Error attempting to delete repository: ${error.message}`;
logger.error(error.message);
throw error;
});
}

Expand Down Expand Up @@ -149,12 +143,9 @@ export class BitBucketServerRepoRef extends AbstractRemoteRepoRef {
response,
}))
.catch(error => {
logger.error(`Error attempting to raise PR`);
return {
success: false,
target: this,
error,
};
error.message = `Error attempting to raise PR: ${error.message}`;
logger.error(error.message);
throw error;
});
}

Expand Down

0 comments on commit 9cb2f9e

Please sign in to comment.