Skip to content

Commit

Permalink
1.0.0-rc40: bugfix - report actual error message when a non-parse-rel…
Browse files Browse the repository at this point in the history
…ated error occurs
  • Loading branch information
daveyarwood committed Sep 18, 2016
1 parent 2bf6462 commit 3ef839d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 17 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 1.0.0-rc40 (9/17/16)

* Bugfix: prior to this release, if evaluating an Alda score resulted in any error, the client would report `ERROR Invalid Alda syntax.`. Now it will report the error message. (This may have been working at some point and then regressed in a recent release. Sorry about that!)

## 1.0.0-rc39 (9/17/16)

* There is [a CPU usage issue](https://github.com/alda-lang/alda/issues/266) that can cause poor performance when cycling out workers, a feature that was implemented in the last release.
Expand Down
2 changes: 1 addition & 1 deletion resources/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.0-rc39
1.0.0-rc40
33 changes: 17 additions & 16 deletions server/src/alda/worker.clj
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,22 @@
(try
(log/debug "Requiring alda.lisp...")
(require '[alda.lisp :refer :all])
(if-let [score (try
(log/debug "Parsing input...")
(parse-input code :map)
(catch Throwable e
(log/error e e)
nil))]
(do
(log/debug "Playing score...")
(future
(reset! playing? true)
(now/play-score! score {:async? false :one-off? false})
(log/debug "Done playing score.")
(reset! playing? false))
(success-response "Playing..."))
(error-response "Invalid Alda syntax."))
(let [score (try
(log/debug "Parsing input...")
(parse-input code :map)
(catch Throwable e
(log/error e e)
{:error e}))]
(if-let [error (:error score)]
(error-response error)
(do
(log/debug "Playing score...")
(future
(reset! playing? true)
(now/play-score! score {:async? false :one-off? false})
(log/debug "Done playing score.")
(reset! playing? false))
(success-response "Playing..."))))
(catch Throwable e
(log/error e e)
(error-response e))))
Expand All @@ -70,7 +71,7 @@
:map (parse-input code mode)))
(catch Throwable e
(log/error e e)
(error-response "Invalid Alda syntax."))))
(error-response e))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Expand Down

0 comments on commit 3ef839d

Please sign in to comment.