Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
3a75e74e
Commit
3a75e74e
authored
Aug 15, 2024
by
Michael Yang
Browse files
only skip invalid json manifests
parent
237dccba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
server/manifest.go
server/manifest.go
+4
-1
No files found.
server/manifest.go
View file @
3a75e74e
...
@@ -5,6 +5,7 @@ import (
...
@@ -5,6 +5,7 @@ import (
"encoding/hex"
"encoding/hex"
"encoding/json"
"encoding/json"
"errors"
"errors"
"fmt"
"io"
"io"
"log/slog"
"log/slog"
"os"
"os"
...
@@ -155,9 +156,11 @@ func Manifests() (map[model.Name]*Manifest, error) {
...
@@ -155,9 +156,11 @@ func Manifests() (map[model.Name]*Manifest, error) {
}
}
m
,
err
:=
ParseNamedManifest
(
n
)
m
,
err
:=
ParseNamedManifest
(
n
)
if
err
!=
nil
{
if
syntax
:=
&
(
json
.
SyntaxError
{});
errors
.
As
(
err
,
&
syntax
)
{
slog
.
Warn
(
"bad manifest"
,
"name"
,
n
,
"error"
,
err
)
slog
.
Warn
(
"bad manifest"
,
"name"
,
n
,
"error"
,
err
)
continue
continue
}
else
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"%s: %w"
,
n
,
err
)
}
}
ms
[
n
]
=
m
ms
[
n
]
=
m
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment