<commit_before>;;; Copyright (C) 2014  <NAME> https://github.com/deadtrickster
;;;
;;; See LICENSE for details.

(in-package :cl-user)

(defpackage :cl-dropbox.conditions
  (:use :cl)
  (:export #:trusted-certificates-file-not-found
           #:cl-dropbox-api-error
           #:cl-dropbox-api-bad-input
           #:cl-dropbox-api-unauthorized
           #:cl-dropbox-api-forbidden
           #:cl-dropbox-api-notfound
           #:cl-dropbox-api-method-not-expected
           #:cl-dropbox-api-too-many-requests
           #:cl-dropbox-api-oauth1.0-rate-limited
           #:cl-dropbox-api-transient-server-error
           #:cl-dropbox-api-over-quota
           #:cl-dropbox-api-error-non-standard))

(in-package :cl-dropbox.conditions)

(define-condition cl-dropbox-error-base (error)
  ()
  (:documentation "Base error class for all cl-dropbox errors"))


(define-condition cl-dropbox-api-error (cl-dropbox-error-base)
  ((response :initarg :response :reader api-error-response))
  (:documentation "Base error class for errors returned by Dropbox API servers"))

(define-condition cl-dropbox-api-bad-input (cl-dropbox-api-error)
  ())

(define-condition cl-dropbox-api-unauthorized (cl-dropbox-api-error)
  ())

(define-condition cl-dropbox-api-forbidden (cl-dropbox-api-error)
  ())

(define-condition cl-dropbox-api-notfound (cl-dropbox-api-error)
  ())

(define-condition cl-dropbox-api-method-not-expected (cl-dropbox-api-error)
  ())

(define-condition cl-dropbox-api-too-many-requests (cl-dropbox-api-error)
  ())

(define-condition cl-dropbox-api-oauth1.0-rate-limited (cl-dropbox-api-error)
  ())

(define-condition cl-dropbox-api-transient-server-error (cl-dropbox-api-error)
  ())

(define-condition cl-dropbox-api-over-quota (cl-dropbox-api-error)
  ())

(define-condition cl-dropbox-api-error-non-standard (cl-dropbox-api-error)
  ())


(define-condition cl-dropbox-error (cl-dropbox-error-base)
  ()
  (:documentation "Base error class for errors occured in cl-dropbox library itself"))

(define-condition trusted-certificates-file-not-found (cl-dropbox-error)
  ((pathname :initarg :pathname))
  (:documentation "Unable to find trusted certificates. Used as cafile")
  (:report (lambda (condition stream)
             (format stream "Unable to find trusted certificates. Path: ~A" (slot-value condition 'pathname)))))
<commit_msg>missing condition class<commit_after>;;; Copyright (C) 2014  <NAME> https://github.com/deadtrickster
;;;
;;; See LICENSE for details.

(in-package :cl-user)

(defpackage :cl-dropbox.conditions
  (:use :cl)
  (:export #:trusted-certificates-file-not-found
           #:cl-dropbox-api-error
           #:cl-dropbox-api-bad-input
           #:cl-dropbox-api-unauthorized
           #:cl-dropbox-api-forbidden
           #:cl-dropbox-api-notfound
           #:cl-dropbox-api-method-not-expected
           #:cl-dropbox-api-too-many-requests
           #:cl-dropbox-api-oauth1.0-rate-limited
           #:cl-dropbox-api-transient-server-error
           #:cl-dropbox-api-server-error
           #:cl-dropbox-api-over-quota
           #:cl-dropbox-api-error-non-standard))

(in-package :cl-dropbox.conditions)

(define-condition cl-dropbox-error-base (error)
  ()
  (:documentation "Base error class for all cl-dropbox errors"))


(define-condition cl-dropbox-api-error (cl-dropbox-error-base)
  ((response :initarg :response :reader api-error-response))
  (:documentation "Base error class for errors returned by Dropbox API servers"))

(define-condition cl-dropbox-api-bad-input (cl-dropbox-api-error)
  ())

(define-condition cl-dropbox-api-unauthorized (cl-dropbox-api-error)
  ())

(define-condition cl-dropbox-api-forbidden (cl-dropbox-api-error)
  ())

(define-condition cl-dropbox-api-notfound (cl-dropbox-api-error)
  ())

(define-condition cl-dropbox-api-method-not-expected (cl-dropbox-api-error)
  ())

(define-condition cl-dropbox-api-too-many-requests (cl-dropbox-api-error)
  ())

(define-condition cl-dropbox-api-oauth1.0-rate-limited (cl-dropbox-api-error)
  ())

(define-condition cl-dropbox-api-transient-server-error (cl-dropbox-api-error)
  ())

(define-condition cl-dropbox-api-server-error (cl-dropbox-api-error)
  ())

(define-condition cl-dropbox-api-over-quota (cl-dropbox-api-error)
  ())

(define-condition cl-dropbox-api-error-non-standard (cl-dropbox-api-error)
  ())


(define-condition cl-dropbox-error (cl-dropbox-error-base)
  ()
  (:documentation "Base error class for errors occured in cl-dropbox library itself"))

(define-condition trusted-certificates-file-not-found (cl-dropbox-error)
  ((pathname :initarg :pathname))
  (:documentation "Unable to find trusted certificates. Used as cafile")
  (:report (lambda (condition stream)
             (format stream "Unable to find trusted certificates. Path: ~A" (slot-value condition 'pathname)))))

{'fraction_non_alphanumeric': 0.15413300186451212, 'fraction_numerical': 0.0033146882121400456, 'mean_word_length': 3.4786641929499074, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4469973', 'n_tokens_mistral': 1701, 'n_tokens_neox': 1624, 'n_words': 278}