tree-poke err handling started

This commit is contained in:
SuperCoolYun 2024-07-11 10:32:44 -04:00
parent d7fbe6928a
commit b2523cde3b
4 changed files with 74 additions and 27 deletions

View File

@ -10,8 +10,10 @@
?+ head ~| [%unknown-head head] !!
%send-poke
=/ =path (stab (got:bod 'pith'))
=/ =stud:neo `@tas`(got:bod 'stud')
=/ =stud:neo !<(@tas (slap !>(~) (ream (got:bod 'stud'))))
~& > got-bod-vase/(got:bod 'vase')
?~ (rush (got:bod 'vase') vest)
[head (pave:neo path) %vase-error !>(~)]
=/ vax=vase (slap !>(.) (ream (got:bod 'vase')))
[head (pave:neo path) stud vax]
::
@ -19,4 +21,4 @@
~& >>> pith/(got:bod 'pith')
=/ path (stab (got:bod 'pith'))
[head (pave:neo path)]
==
==

View File

@ -58,6 +58,7 @@
=/ here p.u.src
^- (list card:neo)
?+ method.request.req ~|(%unsupported-http-method !!)
::
%'GET'
?~ reet=(~(get of:neo q.u.src) /)
=/ bol *bowl:neo
@ -92,6 +93,7 @@
['content-type' 'text/html']~
stub
==
::
%'POST'
=/ purl (parse-url:serv request.req)
=/ content-type (~(gut by pam.purl) 'content-type' 'text/html')
@ -104,29 +106,54 @@
(http-request [poke-stud `request:http`request.req])
=/ diff-type !<(tree-diff diff-vase)
~& >> diff-type/diff-type
=/ cards=(list card:neo)
?- -.diff-type
%send-poke
~[(poke-tree-card our.bowl diff-vase)]
%send-tomb
=/ pax=pith:neo (tail (tail +.diff-type))
=/ poke-card=(list card:neo) ~[(poke-tree-card our.bowl diff-vase)]
=/ kids (kids-to-card pax q.u.src our.bowl here)
?~ kids poke-card
%+ welp (flop kids) poke-card
==
=/ bol *bowl:neo
=. here.bol here
=. our.bol our.bowl
=. now.bol now.bowl
=. eny.bol eny.bowl
%+ welp cards
%: eyre-cards
eyre-id
bol
200
['content-type' 'text/html']~
del-stub
?- -.diff-type
%send-poke
?: =(stud.diff-type %vase-error)
=/ error-stub=manx
;div.p2
=style "color: red;"
;span: failed to parse entered value to hoon
==
%: eyre-cards
eyre-id
bol
200
['content-type' 'text/html']~
error-stub
==
=/ poke-stub=manx
;div.p2
;span: poking
==
%+ welp ~[(poke-tree-card our.bowl diff-vase)]
%: eyre-cards
eyre-id
bol
200
['content-type' 'text/html']~
poke-stub
==
%send-tomb
=/ pax=pith:neo (tail (tail +.diff-type))
=/ poke-card=(list card:neo) ~[(poke-tree-card our.bowl diff-vase)]
=/ kids (kids-to-card pax q.u.src our.bowl here)
?~ kids poke-card
;: welp
(flop kids)
poke-card
%: eyre-cards
eyre-id
bol
200
['content-type' 'text/html']~
del-stub
==
==
==
==
--
@ -309,7 +336,14 @@
; {(en-tape:pith:neo pith)}
==
;div.loader.p2.hover.pointer
=style "grid-column: 3 ; grid-row: 1; justify-self: end; border: 2px solid black; border-radius: 6px;"
=style
"""
grid-column: 3;
grid-row: 1;
justify-self: end;
border: 2px solid black;
border-radius: 6px;
"""
=onclick "$(this).next().toggleClass('hidden');"
;span.loaded: tomb
;span.loading: loading
@ -373,14 +407,14 @@
^- manx
;form
=hx-post "/neo/tree{(en-tape:pith:neo here.bowl)}?stud=tree-diff&head=send-poke"
=hx-target "find .loading"
=hx-swap "outerHTML"
:: =hx-target "find .loader"
=hx-swap "beforeend"
;input
=type "text"
=name "stud"
=oninput "this.setAttribute('value', this.value);"
=autocomplete "off"
=placeholder "diff-type"
=placeholder "%diff-type"
=required ""
;
==

View File

@ -23,8 +23,19 @@
::
%ack
:: ~& >> ack-vase-type/+.vase
:: ~& >> ack/!<((unit quit:neo) vase)
[~ tree/!>(~)]
:: ~& >> ack/!<((unit quit:neo) vase)
=/ =quit:neo (need !<((unit quit:neo) vase))
?+ -.quit [~ tree/!>(~)]
%goof
=/ =tang +.quit
:: send error trace back to eyre-handler
=/ trace
%+ turn tang
|= =tank
~& > ~(ram re tank)
tank
[~ tree/!>(~)]
==
::
%tree-diff
=/ diff !<(tree-diff vase)

View File

@ -1,4 +1,4 @@
$%
[%send-poke pith=pith:neo stud=stud:neo vase=vase]
[%send-poke =pith:neo =stud:neo =vase]
[%send-tomb =pith:neo]
==