Skip to content

Commit 6067fb6

Browse files
committed
allow error type as tag
1 parent 399a5a9 commit 6067fb6

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

jaws/tag.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ func tagExpand(l int, rq *Request, tag any, result []any) ([]any, error) {
5050
case float32:
5151
case float64:
5252
case bool:
53-
case error:
5453

5554
case nil:
5655
return result, nil

jaws/tag_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ func TestTagExpand(t *testing.T) {
5252
tag: []any{Tag("a"), &av},
5353
want: []any{Tag("a"), &av},
5454
},
55+
{
56+
name: "error",
57+
tag: ErrEventUnhandled,
58+
want: []any{ErrEventUnhandled},
59+
},
5560
}
5661
for _, tt := range tests {
5762
t.Run(tt.name, func(t *testing.T) {
@@ -84,7 +89,6 @@ func TestTagExpand_IllegalTypesPanic(t *testing.T) {
8489
float32(11),
8590
float64(12),
8691
bool(true),
87-
errors.New("error"),
8892
[]string{"a", "b"},
8993
[]template.HTML{"a", "b"},
9094
map[int]int{1: 1},

0 commit comments

Comments
 (0)