mirror of
https://github.com/CJackHwang/ds2api.git
synced 2026-05-18 07:05:08 +08:00
feat: Implement admin settings UI, enhance admin authentication with password hashing, and add new streaming runtime logic for Claude and OpenAI adapters with extensive compatibility tests.
This commit is contained in:
23
internal/admin/request_error.go
Normal file
23
internal/admin/request_error.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package admin
|
||||
|
||||
import "errors"
|
||||
|
||||
type requestError struct {
|
||||
detail string
|
||||
}
|
||||
|
||||
func (e *requestError) Error() string {
|
||||
return e.detail
|
||||
}
|
||||
|
||||
func newRequestError(detail string) error {
|
||||
return &requestError{detail: detail}
|
||||
}
|
||||
|
||||
func requestErrorDetail(err error) (string, bool) {
|
||||
var reqErr *requestError
|
||||
if errors.As(err, &reqErr) {
|
||||
return reqErr.detail, true
|
||||
}
|
||||
return "", false
|
||||
}
|
||||
Reference in New Issue
Block a user