jys 1 år sedan
förälder
incheckning
05836f0b7b
2 ändrade filer med 172 tillägg och 48 borttagningar
  1. 0 48
      README.md
  2. 172 0
      logs/log

+ 0 - 48
README.md

@@ -1,48 +0,0 @@
-# fserr
-
-方是错误封装
-
-# v2alpha版本更新
-
-## 特性
-1. 采用6位错误码定位具体错误类型,并根据错误类型给出更加具体的错误信息;
-2. 用户无感知的栈信息;
-3. 兼容主流错误风格及api,高度可替换性。
-
-## 快速开始
-
-```go
-package main
-
-import (
-	"fmt"
-	"git.sxidc.com/service-supports/fserr/v2alpha"
-)
-
-const (
-	ErrProjectNotExist = iota + 201
-)
-
-func init() {
-	// 设置服务码
-	fserr.SetAppCode(10)
-
-	// fserr包内置错误码
-	fserr.NewOK(fserr.ErrDb, "处理失败,请联系开发人员")
-
-	// 业务模块错误
-	fserr.NewOK(ErrProjectNotExist, "项目不存在")
-}
-
-func Add() error {
-	return fserr.WithCode(nil, ErrProjectNotExist)
-}
-
-func main() {
-	err := Add()
-	if err != nil {
-		fmt.Printf("%+v\n", fserr.ParseCode(err))
-		return
-	}
-}
-```

+ 172 - 0
logs/log

@@ -0,0 +1,172 @@
+2023-09-05T15:37:24.522+0800	ERROR	test/main.go:10	
+aaa
+
+2023-09-05T15:37:35.702+0800	ERROR	test/main.go:10	
+aaa
+main.b
+	C:/Users/26897/gopath/src/fserr/test/main.go:18
+main.a
+	C:/Users/26897/gopath/src/fserr/test/main.go:14
+main.main
+	C:/Users/26897/gopath/src/fserr/test/main.go:9
+runtime.main
+	C:/Program Files/Go/src/runtime/proc.go:267
+runtime.goexit
+	C:/Program Files/Go/src/runtime/asm_amd64.s:1650
+
+2023-09-05T15:37:47.586+0800	ERROR	test/main.go:10	
+aaa
+
+2023-09-05T15:37:55.463+0800	ERROR	test/main.go:10	
+aaa
+
+
+2023-09-05T15:39:28.848+0800	ERROR	test/main.go:10	
+aaa
+
+2023-09-05T15:51:21.420+0800	ERROR	test/main.go:10	
+aaa
+
+2023-09-05T15:51:28.285+0800	ERROR	test/main.go:10	
+aaa
+
+2023-09-05T15:51:55.549+0800	ERROR	test/main.go:10	
+aaa
+
+2023-09-05T16:02:52.141+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-09-05T16:02:52.153+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-09-05T16:02:52.153+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-09-05T16:02:52.153+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-09-05T16:02:52.153+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-09-05T16:02:52.153+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-09-05T16:02:52.153+0800	WARN	fserr/center.go:18	duplicate business code, code: 300001, message: basic error
+2023-09-05T16:02:52.153+0800	WARN	fserr/center.go:18	duplicate business code, code: 300001, message: basic error
+2023-09-05T16:03:02.131+0800	WARN	fserr/center.go:18	duplicate business code, code: 300001, message: basic error
+2023-09-05T16:03:22.744+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-09-05T16:03:22.754+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-09-05T16:03:22.754+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-09-05T16:03:22.754+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-09-05T16:03:22.754+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-09-05T16:03:22.754+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-09-05T16:03:22.754+0800	WARN	fserr/center.go:18	duplicate business code, code: 300001, message: basic error
+2023-09-05T16:03:22.754+0800	WARN	fserr/center.go:18	duplicate business code, code: 300001, message: basic error
+2023-09-05T16:03:26.771+0800	ERROR	fserr/public_test.go:132	
+stack error
+git.sxidc.com/service-supports/fserr.(*TestPublicSuite).SetupTest
+	C:/Users/26897/gopath/src/fserr/public_test.go:42
+github.com/stretchr/testify/suite.Run.func1
+	C:/Users/26897/gopath/pkg/mod/github.com/stretchr/testify@v1.8.3/suite/suite.go:187
+testing.tRunner
+	C:/Program Files/Go/src/testing/testing.go:1595
+runtime.goexit
+	C:/Program Files/Go/src/runtime/asm_amd64.s:1650
+
+2023-09-05T16:03:34.181+0800	WARN	fserr/center.go:18	duplicate business code, code: 300001, message: basic error
+2023-09-05T16:04:11.072+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-09-05T16:04:11.081+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-09-05T16:04:11.081+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-09-05T16:04:11.082+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-09-05T16:04:11.082+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-09-05T16:04:11.082+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-09-05T16:04:11.082+0800	WARN	fserr/center.go:18	duplicate business code, code: 300001, message: basic error
+2023-09-05T16:04:11.082+0800	WARN	fserr/center.go:18	duplicate business code, code: 300001, message: basic error
+2023-09-05T16:04:11.082+0800	ERROR	fserr/public_test.go:132	
+stack error
+git.sxidc.com/service-supports/fserr.(*TestPublicSuite).SetupTest
+	C:/Users/26897/gopath/src/fserr/public_test.go:42
+github.com/stretchr/testify/suite.Run.func1
+	C:/Users/26897/gopath/pkg/mod/github.com/stretchr/testify@v1.8.3/suite/suite.go:187
+testing.tRunner
+	C:/Program Files/Go/src/testing/testing.go:1595
+runtime.goexit
+	C:/Program Files/Go/src/runtime/asm_amd64.s:1650
+
+2023-09-05T16:04:11.082+0800	WARN	fserr/center.go:18	duplicate business code, code: 300001, message: basic error
+2023-10-20T10:05:20.271+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-10-20T10:05:20.280+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-10-20T10:05:20.280+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-10-20T10:05:20.280+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-10-20T10:05:20.280+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-10-20T10:05:20.280+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-10-20T10:05:20.280+0800	WARN	fserr/center.go:18	duplicate business code, code: 3000000001, message: basic error
+2023-10-20T10:05:20.280+0800	WARN	fserr/center.go:18	duplicate business code, code: 3000000001, message: basic error
+2023-10-20T10:05:20.281+0800	ERROR	fserr/public_test.go:132	
+stack error
+git.sxidc.com/service-supports/fserr.(*TestPublicSuite).SetupTest
+	C:/Users/26897/gopath/src/fserr/public_test.go:42
+github.com/stretchr/testify/suite.Run.func1
+	C:/Users/26897/gopath/pkg/mod/github.com/stretchr/testify@v1.8.3/suite/suite.go:187
+testing.tRunner
+	C:/Program Files/Go/src/testing/testing.go:1595
+runtime.goexit
+	C:/Program Files/Go/src/runtime/asm_amd64.s:1650
+
+2023-10-20T10:05:20.281+0800	WARN	fserr/center.go:18	duplicate business code, code: 3000000001, message: basic error
+2023-10-20T10:08:38.948+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-10-20T10:08:38.955+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-10-20T10:08:38.955+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-10-20T10:08:38.955+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-10-20T10:08:38.955+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-10-20T10:08:38.956+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-10-20T10:08:38.956+0800	WARN	fserr/center.go:18	duplicate business code, code: 30001, message: basic error
+2023-10-20T10:08:38.956+0800	WARN	fserr/center.go:18	duplicate business code, code: 30001, message: basic error
+2023-10-20T10:08:38.956+0800	ERROR	fserr/public_test.go:132	
+stack error
+git.sxidc.com/service-supports/fserr.(*TestPublicSuite).SetupTest
+	C:/Users/26897/gopath/src/fserr/public_test.go:42
+github.com/stretchr/testify/suite.Run.func1
+	C:/Users/26897/gopath/pkg/mod/github.com/stretchr/testify@v1.8.3/suite/suite.go:187
+testing.tRunner
+	C:/Program Files/Go/src/testing/testing.go:1595
+runtime.goexit
+	C:/Program Files/Go/src/runtime/asm_amd64.s:1650
+
+2023-10-20T10:08:38.956+0800	WARN	fserr/center.go:18	duplicate business code, code: 30001, message: basic error
+2023-10-20T10:08:53.173+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-10-20T10:08:53.182+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-10-20T10:08:53.182+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-10-20T10:08:53.182+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-10-20T10:08:53.182+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-10-20T10:08:53.182+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-10-20T10:08:53.182+0800	WARN	fserr/center.go:18	duplicate business code, code: 30001, message: basic error
+2023-10-20T10:08:53.182+0800	WARN	fserr/center.go:18	duplicate business code, code: 30001, message: basic error
+2023-10-20T10:08:53.183+0800	ERROR	fserr/public_test.go:132	
+stack error
+git.sxidc.com/service-supports/fserr.(*TestPublicSuite).SetupTest
+	C:/Users/26897/gopath/src/fserr/public_test.go:42
+github.com/stretchr/testify/suite.Run.func1
+	C:/Users/26897/gopath/pkg/mod/github.com/stretchr/testify@v1.8.3/suite/suite.go:187
+testing.tRunner
+	C:/Program Files/Go/src/testing/testing.go:1595
+runtime.goexit
+	C:/Program Files/Go/src/runtime/asm_amd64.s:1650
+
+2023-10-20T10:08:53.183+0800	WARN	fserr/center.go:18	duplicate business code, code: 30001, message: basic error
+2023-10-20T10:09:03.537+0800	WARN	fserr/center.go:18	duplicate business code, code: 1001, message: ok
+2023-10-20T10:09:03.545+0800	WARN	fserr/center.go:18	duplicate business code, code: 1001, message: ok
+2023-10-20T10:09:03.545+0800	WARN	fserr/center.go:18	duplicate business code, code: 1001, message: ok
+2023-10-20T10:09:03.546+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-10-20T10:09:03.546+0800	WARN	fserr/center.go:18	duplicate business code, code: 100102, message: customer error
+2023-10-20T10:09:03.546+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-10-20T10:09:03.546+0800	WARN	fserr/center.go:18	duplicate business code, code: 100102, message: customer error
+2023-10-20T10:09:03.548+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-10-20T10:09:03.548+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-10-20T10:09:03.548+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-10-20T10:09:03.548+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-10-20T10:09:03.548+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-10-20T10:09:03.549+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-10-20T10:09:03.549+0800	WARN	fserr/center.go:18	duplicate business code, code: 1, message: basic error
+2023-10-20T10:09:03.549+0800	WARN	fserr/center.go:18	duplicate business code, code: 30001, message: basic error
+2023-10-20T10:09:03.549+0800	WARN	fserr/center.go:18	duplicate business code, code: 30001, message: basic error
+2023-10-20T10:09:03.549+0800	ERROR	fserr/public_test.go:132	
+stack error
+git.sxidc.com/service-supports/fserr.(*TestPublicSuite).SetupTest
+	C:/Users/26897/gopath/src/fserr/public_test.go:42
+github.com/stretchr/testify/suite.Run.func1
+	C:/Users/26897/gopath/pkg/mod/github.com/stretchr/testify@v1.8.3/suite/suite.go:187
+testing.tRunner
+	C:/Program Files/Go/src/testing/testing.go:1595
+runtime.goexit
+	C:/Program Files/Go/src/runtime/asm_amd64.s:1650
+
+2023-10-20T10:09:03.549+0800	WARN	fserr/center.go:18	duplicate business code, code: 30001, message: basic error