 
     # ----------------------------------------------------------------------------------------------
     describe '".pd maintenances"', ->
+      context 'when something goes wrong,', ->
+        beforeEach ->
+          nock('https://api.pagerduty.com')
+          .get('/maintenance windows?filter=ongoing')
+          .reply 503, { error: { code: 503, message: "it's all broken!" } }
+        afterEach ->
+          room.robot.brain.data.pagerv2 = { }
+          nock.cleanAll()
+
+        say 'pd maintenances', ->
+          it 'returns the error message', ->
+            expect(hubotResponse())
+            .to.eql "503 it's all broken!"
+
       context 'when everything goes right,', ->
         beforeEach ->
           nock('https://api.pagerduty.com')


    # ----------------------------------------------------------------------------------------------
    describe '".pd ack PT4KHLK"', ->
      context 'when everything goes right,', ->
        beforeEach ->
          nock('https://api.pagerduty.com')


    # ----------------------------------------------------------------------------------------------
    describe '".pd snooze all"', ->
      context 'when something goes wrong,', ->
        beforeEach ->
          nock('https://api.pagerduty.com')
          .get('/incidents?time_zone=UTC&include%5B%5D=first_trigger_log_entry&date_range=all' +
               '&statuses%5B%5D=triggered&statuses%5B%5D=acknowledged')
          .reply 503, { error: { code: 503, message: "it's all broken!" } }
        afterEach ->
          room.robot.brain.data.pagerv2 = { }
          nock.cleanAll()

        say 'pd snooze all', ->
          it 'returns the error message', ->
            expect(hubotResponse())
            .to.eql "503 it's all broken!"

      context 'when everything goes right,', ->
        beforeEach ->
          nock('https://api.pagerduty.com')
