@@ -8,6 +8,10 @@ module Internal = {
8
8
v |> Json . Encode . encode_value(encoder) |> Reply . okJson;
9
9
};
10
10
11
+ let mapEncoderError = (encoder, v) => {
12
+ v |> Json . Encode . encode_value(encoder) |> Reply . errorJson;
13
+ };
14
+
11
15
let fileTypeFromStat : Luv . File . Stat . t => Files . FileType . t =
12
16
(statResult: Luv . File . Stat . t ) => {
13
17
Luv . File . (
@@ -103,7 +107,7 @@ let update = (msg, model) => {
103
107
Exthost . Files . FileSystemError . (
104
108
make(Code . fileNotFound)
105
109
|> Lwt . return
106
- |> Lwt . map(Internal . mapEncoder (encode))
110
+ |> Lwt . map(Internal . mapEncoderError (encode))
107
111
)
108
112
},
109
113
);
@@ -128,7 +132,7 @@ let update = (msg, model) => {
128
132
Exthost . Files . FileSystemError . (
129
133
make(Code . fileNotFound)
130
134
|> Lwt . return
131
- |> Lwt . map(Internal . mapEncoder (encode))
135
+ |> Lwt . map(Internal . mapEncoderError (encode))
132
136
)
133
137
},
134
138
);
@@ -148,7 +152,7 @@ let update = (msg, model) => {
148
152
Exthost . Files . FileSystemError . (
149
153
make(Code . fileNotFound)
150
154
|> Lwt . return
151
- |> Lwt . map(Internal . mapEncoder (encode))
155
+ |> Lwt . map(Internal . mapEncoderError (encode))
152
156
)
153
157
},
154
158
);
@@ -196,7 +200,7 @@ let update = (msg, model) => {
196
200
Exthost . Files . FileSystemError . (
197
201
make(Code . fileNotFound)
198
202
|> Lwt . return
199
- |> Lwt . map(Internal . mapEncoder (encode))
203
+ |> Lwt . map(Internal . mapEncoderError (encode))
200
204
)
201
205
},
202
206
);
0 commit comments