Skip to content

Instantly share code, notes, and snippets.

@mdelaurentis
Created December 1, 2015 18:46
Show Gist options
  • Save mdelaurentis/d3b51cbdc9d40932df18 to your computer and use it in GitHub Desktop.
Save mdelaurentis/d3b51cbdc9d40932df18 to your computer and use it in GitHub Desktop.
;; Good
(try
(insert-a-batch …)
(publish-message {:type “redshift-connection”, :state “ok”, :client_id 3, :connection_id 123, :created-at “…”})
(catch DiskFullError e
(publish-message {”redshift-connection”, :state “error”, :client_id 3, “error-type “disk full”, :created-at "..."}))
(catch ConnectionError e
(publish-message {”redshift-connection”, :state “error”, :client_id 3, “error-type “connection error”, :created-at "..."})))
;; Bad
(try
(insert-a-batch …)
(publish-message {:type “redshift-disk-full”, :state “ok”, :client_id 3, :connection_id 123, :created-at “…”})
(publish-message {:type “redshift-connection-error”, :state “ok”, :client_id 3, :connection_id 123, :created-at “…”})
(catch DiskFullError e
(publish-message {:type ”redshift-disk-full”, :state “error”, :client_id 3, :created-at "..."})
(publish-message {:type ”redshift-connection-error”, :state “ok”, :client_id 3, :created-at "..."}))
(catch ConnectionError e
(publish-message {:type ”redshift-disk-full”, :state “ok”, :client_id 3, :created-at "..."})
(publish-message {:type ”redshift-connection-error”, :state “error”, :client_id 3, :created-at "..."})))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment