Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- return new RSVP.Promise(function(Resolve, Reject) {
- if (!Obj.ID) {
- Reject('Invalid ID');
- } else {
- DB.Bucket.insert(Obj.ID, Obj, function(E, Result) {
- if (E) {
- if (E.code == 12) {
- /* The specified ID is already being used */
- /* This is where I need to start a "retry" with a new ID */
- } else {
- Reject(E); // Error Writing
- }
- } else {
- Resolve(Obj); // Successful Write
- }
- });
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement