             (when result
               (if (and (not (vectorp result))
                        (assq 'exception result))
-                  (ycmd--handle-exception result)
+                  (ycmd--handle-exception type result)
                 (when success-handler
                   (funcall success-handler result))))))))))
 

Otherwise the response is probably an exception."
  (if (and (not (vectorp results))
           (assq 'exception results))
      (ycmd--handle-exception results)
    (ycmd--report-status 'parsed)
    (run-hook-with-args 'ycmd-file-parse-result-hook results)))


  "Whether to confirm when applying fixit on line."
  :group 'ycmd
  :type 'boolean)

(defcustom ycmd-after-exception-hook nil
  "Function to run if server request resulted in exception.

This hook is run whenever an exception is thrown after a ycmd
server request.  Two arguments are passed to the function, a
string with the type of request that triggerd the exception and
the server response structure which looks like this:

  ((exception
    (TYPE . \"RuntimeError\"))
   (traceback . \"long traceback string\")
   (message . \"Can't jump to definition.\"))

This variable is a normal hook.  See Info node `(elisp)Hooks'."
  :group 'ycmd
  :type 'hook
  :risky t)

(defconst ycmd--diagnostic-file-types
  '("c"
