Skip to content

Commit

Permalink
fixing error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
saikyun committed Sep 14, 2021
1 parent af29c15 commit cdd082c
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 4 deletions.
3 changes: 2 additions & 1 deletion freja/echoer.janet
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@
(if-let [fib (res :fiber)]
(debug/stacktrace fib
(or (res :msg) (res :error)))
(pp (res :error)))
(do (print "no fiber")
(pp (res :error))))
(pp (res :value))))

(defn init
Expand Down
16 changes: 15 additions & 1 deletion freja/events.janet
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,21 @@
(push! state/eval-results (if (and (dictionary? err) (err :error))
err
{:error err
:msg (string/format "%p event into %p" v puller)
:fiber fib
:msg (string/format ``
%s
event:
%p
subscriber:
%p
``
err
(if (dictionary? v)
(string/format "dictionary with keys: %p" (keys v))
v)
(if (dictionary? puller)
(string/format "dictionary with keys: %p" (keys puller))
puller))
:cause [v puller]})))))
v) # if there was a value, we return it
)
Expand Down
1 change: 0 additions & 1 deletion freja/hiccup.janet
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@
# (ch/print-tree (self :root)))
# (print "(self :root) is nil"))


(when (self :remove-layer-on-error)
(print "Removing layer: " (self :name))
(remove-layer (self :name) (self :props))))))})
Expand Down
4 changes: 4 additions & 0 deletions freja/main.janet
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@
(import ./echoer :as echoer)
(put module/cache "freja/echoer" echoer)

(def vector-math (require "./vector-math"))
(import ./vector-math :as vector-math)
(put module/cache "freja/vector-math" vector-math)

(def flow (require "./flow"))
(import ./flow :as flow)
(put module/cache "freja/flow" flow)
Expand Down
2 changes: 2 additions & 0 deletions install
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
rm -rf build && jpm build && sudo jpm install
18 changes: 17 additions & 1 deletion misc/sound.janet
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
(use freja-jaylib)

(init-audio-device)
(import freja/frp)
(import freja/state)

(comment
(do
(var cp 0)
(frp/subscribe! (get-in state/editor-state [:left-state :editor])
(fn [state]
(unless (= cp (get-in state [:gb :caret-pos]))
(play-sound (weak (rand-pos weak)))
(set cp (get-in state [:gb :caret-pos])))))
:ok)
#
)


# (init-audio-device)

(def weak (->> [(load-wave "misc/sound/svag1.wav")
(load-wave "misc/sound/svag2.wav")
Expand Down

0 comments on commit cdd082c

Please sign in to comment.