         (opt[k] = v) for k, v of arg
       opt.callback = (result) ->
         return resolve() if result
-        return reject(Error("Cancelled"))
+        return reject(new global.bootbox.CancellationError())
       global.bootbox.confirm(opt)
     )
 
-if global.bootbox?.prompt?
+if global.bootbox.prompt?
   global.bootbox.prompt_p = (arg) ->
     return new Promise((resolve, reject) ->
       opt = {}

      global.bootbox.alert(opt)
    )

if global.bootbox?.confirm?
  global.bootbox.confirm_p = (arg) ->
    return new Promise((resolve, reject) ->
      opt = {}

      global.bootbox.dialog(opt)
    )

