Skip to content

Commit

Permalink
[EXPERIMENTAL] Service framework (#1111)
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Collison <[email protected]>
Co-authored-by: Derek Collison <[email protected]>
Co-authored-by: Alberto Ricart Collison <[email protected]>
Co-authored-by: Piotr Piotrowski <[email protected]>
  • Loading branch information
3 people authored Oct 27, 2022
1 parent ffbe2f9 commit 11293d3
Show file tree
Hide file tree
Showing 5 changed files with 691 additions and 2 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ go 1.16
require (
github.com/nats-io/nkeys v0.3.0
github.com/nats-io/nuid v1.0.1
)
)
2 changes: 1 addition & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
25 changes: 25 additions & 0 deletions services/errors.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright 2022 The NATS Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package services

import "fmt"

type ServiceAPIError struct {
ErrorCode int
Description string
}

func (e *ServiceAPIError) Error() string {
return fmt.Sprintf("%d %s", e.ErrorCode, e.Description)
}
Loading

0 comments on commit 11293d3

Please sign in to comment.