FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
opencode/packages/opencode/src/cli/error.ts at dev · petebytes/opencode · GitHub
petebytes
/
opencode
Public
forked from
anomalyco/opencode
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
opencode
/
packages
/
opencode
/
src
/
cli
/
error.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
19 lines (17 loc) · 703 Bytes
Breadcrumbs
opencode
/
packages
/
opencode
/
src
/
cli
/
error.ts
Copy path
File metadata and controls
19 lines (17 loc) · 703 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import
{
Config
}
from
"../config/config"
import
{
MCP
}
from
"../mcp"
import
{
UI
}
from
"./ui"
export
function
FormatError
(
input
:
unknown
)
{
if
(
MCP
.
Failed
.
isInstance
(
input
)
)
return
`MCP server "
${
input
.
data
.
name
}
" failed. Note, opencode does not support MCP authentication yet.`
if
(
Config
.
JsonError
.
isInstance
(
input
)
)
return
`Config file at
${
input
.
data
.
path
}
is not valid JSON`
if
(
Config
.
InvalidError
.
isInstance
(
input
)
)
return
[
`Config file at
${
input
.
data
.
path
}
is invalid`
,
...
(
input
.
data
.
issues
?.
map
(
(
issue
)
=>
"↳ "
+
issue
.
message
+
" "
+
issue
.
path
.
join
(
"."
)
,
)
??
[
]
)
,
]
.
join
(
"\n"
)
if
(
UI
.
CancelledError
.
isInstance
(
input
)
)
return
""
}
Back
|
FazBrowse Home
|
New Git URL