diff options
| author | Fuwn <[email protected]> | 2026-02-28 04:52:17 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-02-28 04:52:17 -0800 |
| commit | bb02fa43e5776e3d7b95cb47f0594eb4bd7f907f (patch) | |
| tree | 9d2e2f49c2e0cb9e153ca266d10b9b610e38c771 /internal/api/server.go | |
| parent | build(task): add multi-arch docker build targets (diff) | |
| download | plutia-test-bb02fa43e5776e3d7b95cb47f0594eb4bd7f907f.tar.xz plutia-test-bb02fa43e5776e3d7b95cb47f0594eb4bd7f907f.zip | |
docs: refine user-facing wording for clarity and consistency
Diffstat (limited to 'internal/api/server.go')
| -rw-r--r-- | internal/api/server.go | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/internal/api/server.go b/internal/api/server.go index a3b4513..158a6fe 100644 --- a/internal/api/server.go +++ b/internal/api/server.go @@ -137,7 +137,7 @@ func (s *Server) handleLatestCheckpoint(w http.ResponseWriter, r *http.Request) } if !ok { - writeErr(w, http.StatusNotFound, fmt.Errorf("no checkpoint available")) + writeErr(w, http.StatusNotFound, fmt.Errorf("No checkpoint is available.")) return } @@ -149,7 +149,7 @@ func (s *Server) handleCheckpointBySequence(w http.ResponseWriter, r *http.Reque path := strings.TrimPrefix(r.URL.Path, "/checkpoints/") if path == "" { - writeErr(w, http.StatusNotFound, fmt.Errorf("missing checkpoint sequence in request path")) + writeErr(w, http.StatusNotFound, fmt.Errorf("Missing checkpoint sequence in request path.")) return } @@ -157,7 +157,7 @@ func (s *Server) handleCheckpointBySequence(w http.ResponseWriter, r *http.Reque seq, err := strconv.ParseUint(path, 10, 64) if err != nil { - writeErr(w, http.StatusBadRequest, fmt.Errorf("invalid checkpoint sequence")) + writeErr(w, http.StatusBadRequest, fmt.Errorf("Invalid checkpoint sequence.")) return } @@ -171,7 +171,7 @@ func (s *Server) handleCheckpointBySequence(w http.ResponseWriter, r *http.Reque } if !ok { - writeErr(w, http.StatusNotFound, fmt.Errorf("checkpoint not found")) + writeErr(w, http.StatusNotFound, fmt.Errorf("Checkpoint not found.")) return } @@ -183,7 +183,7 @@ func (s *Server) handleDID(w http.ResponseWriter, r *http.Request) { path := strings.TrimPrefix(r.URL.Path, "/did/") if path == "" { - writeErr(w, http.StatusBadRequest, fmt.Errorf("missing DID in request path")) + writeErr(w, http.StatusBadRequest, fmt.Errorf("Missing DID in request path.")) return } @@ -192,7 +192,7 @@ func (s *Server) handleDID(w http.ResponseWriter, r *http.Request) { did := strings.TrimSuffix(path, "/proof") if !s.allowRequest(r, limiterProof) { - writeErr(w, http.StatusTooManyRequests, fmt.Errorf("too many proof requests. Try again later.")) + writeErr(w, http.StatusTooManyRequests, fmt.Errorf("Too many proof requests. Try again later.")) return } @@ -203,7 +203,7 @@ func (s *Server) handleDID(w http.ResponseWriter, r *http.Request) { } if !s.allowRequest(r, limiterResolve) { - writeErr(w, http.StatusTooManyRequests, fmt.Errorf("too many resolve requests. Try again later.")) + writeErr(w, http.StatusTooManyRequests, fmt.Errorf("Too many resolve requests. Try again later.")) return } @@ -217,7 +217,7 @@ func (s *Server) handleDIDResolve(w http.ResponseWriter, r *http.Request, did st resolvedState, err := s.ingestor.ResolveState(r.Context(), did) if err != nil { if errors.Is(err, ingest.ErrDIDNotFound) { - writeErr(w, http.StatusNotFound, fmt.Errorf("DID not found")) + writeErr(w, http.StatusNotFound, fmt.Errorf("DID not found.")) return } @@ -243,7 +243,7 @@ func (s *Server) handleDIDResolve(w http.ResponseWriter, r *http.Request, did st } if !ok { - writeErr(w, http.StatusNotFound, fmt.Errorf("DID not found")) + writeErr(w, http.StatusNotFound, fmt.Errorf("DID not found.")) return } @@ -277,13 +277,13 @@ func (s *Server) handleDIDResolve(w http.ResponseWriter, r *http.Request, did st func (s *Server) handleDIDProof(w http.ResponseWriter, r *http.Request, did string) { if s.cfg.Mode == config.ModeThin { - writeErr(w, http.StatusNotImplemented, fmt.Errorf("thin mode does not support checkpoint proofs")) + writeErr(w, http.StatusNotImplemented, fmt.Errorf("Thin mode does not support checkpoint proofs.")) return } if s.ingestor == nil { - writeErr(w, http.StatusServiceUnavailable, fmt.Errorf("service unavailable")) + writeErr(w, http.StatusServiceUnavailable, fmt.Errorf("Service unavailable.")) return } @@ -331,7 +331,7 @@ func (s *Server) handleDIDProof(w http.ResponseWriter, r *http.Request, did stri } if !found { - writeErr(w, http.StatusNotFound, fmt.Errorf("DID is not present in the checkpoint state")) + writeErr(w, http.StatusNotFound, fmt.Errorf("DID is not present in the checkpoint state.")) return } @@ -1016,7 +1016,7 @@ func (s *Server) selectCheckpointForProof(r *http.Request) (types.CheckpointV1, } if !ok { - return types.CheckpointV1{}, nil, fmt.Errorf("no checkpoint available") + return types.CheckpointV1{}, nil, fmt.Errorf("No checkpoint is available.") } return cp, func() error { @@ -1041,7 +1041,7 @@ func (s *Server) selectCheckpointForProof(r *http.Request) (types.CheckpointV1, seq, err := strconv.ParseUint(checkpointParam, 10, 64) if err != nil { - return types.CheckpointV1{}, nil, fmt.Errorf("invalid checkpoint query parameter") + return types.CheckpointV1{}, nil, fmt.Errorf("Invalid checkpoint query parameter.") } cp, ok, err := s.store.GetCheckpoint(seq) |