fix: del the repeated wrap and add err print

pull/1872/head
luhaoling 2 years ago
parent e33c66ca6c
commit ee8c7fd904

@ -43,7 +43,8 @@ func main() {
apiCmd.AddPortFlag()
apiCmd.AddApi(run)
if err := apiCmd.Execute(); err != nil {
panic(err.Error())
fmt.Fprintf(os.Stderr, "\n\nexit -1: \n%+v\n\n", err)
os.Exit(-1)
}
}

@ -15,7 +15,9 @@
package main
import (
"fmt"
"github.com/openimsdk/open-im-server/v3/pkg/common/cmd"
"os"
)
func main() {
@ -54,6 +56,7 @@ func main() {
// openIM clear msg --clearAll
msgUtilsCmd.AddCommand(&getCmd.Command, &fixCmd.Command, &clearCmd.Command)
if err := msgUtilsCmd.Execute(); err != nil {
panic(err)
fmt.Fprintf(os.Stderr, "\n\nexit -1: \n%+v\n\n", err)
os.Exit(-1)
}
}

@ -15,13 +15,16 @@
package main
import (
"fmt"
"github.com/openimsdk/open-im-server/v3/internal/tools"
"github.com/openimsdk/open-im-server/v3/pkg/common/cmd"
"os"
)
func main() {
cronTaskCmd := cmd.NewCronTaskCmd()
if err := cronTaskCmd.Exec(tools.StartTask); err != nil {
panic(err.Error())
fmt.Fprintf(os.Stderr, "\n\nexit -1: \n%+v\n\n", err)
os.Exit(-1)
}
}

@ -15,7 +15,9 @@
package main
import (
"fmt"
"github.com/openimsdk/open-im-server/v3/pkg/common/cmd"
"os"
)
func main() {
@ -25,6 +27,7 @@ func main() {
msgGatewayCmd.AddPrometheusPortFlag()
if err := msgGatewayCmd.Exec(); err != nil {
panic(err.Error())
fmt.Fprintf(os.Stderr, "\n\nexit -1: \n%+v\n\n", err)
os.Exit(-1)
}
}

@ -15,7 +15,9 @@
package main
import (
"fmt"
"github.com/openimsdk/open-im-server/v3/pkg/common/cmd"
"os"
)
func main() {
@ -23,6 +25,7 @@ func main() {
msgTransferCmd.AddPrometheusPortFlag()
msgTransferCmd.AddTransferProgressFlag()
if err := msgTransferCmd.Exec(); err != nil {
panic(err.Error())
fmt.Fprintf(os.Stderr, "\n\nexit -1: \n%+v\n\n", err)
os.Exit(-1)
}
}

@ -15,9 +15,11 @@
package main
import (
"fmt"
"github.com/openimsdk/open-im-server/v3/internal/push"
"github.com/openimsdk/open-im-server/v3/pkg/common/cmd"
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
"os"
)
func main() {
@ -28,6 +30,7 @@ func main() {
panic(err.Error())
}
if err := pushCmd.StartSvr(config.Config.RpcRegisterName.OpenImPushName, push.Start); err != nil {
panic(err.Error())
fmt.Fprintf(os.Stderr, "\n\nexit -1: \n%+v\n\n", err)
os.Exit(-1)
}
}

@ -15,9 +15,11 @@
package main
import (
"fmt"
"github.com/openimsdk/open-im-server/v3/internal/rpc/auth"
"github.com/openimsdk/open-im-server/v3/pkg/common/cmd"
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
"os"
)
func main() {
@ -28,6 +30,7 @@ func main() {
panic(err.Error())
}
if err := authCmd.StartSvr(config.Config.RpcRegisterName.OpenImAuthName, auth.Start); err != nil {
panic(err.Error())
fmt.Fprintf(os.Stderr, "\n\nexit -1: \n%+v\n\n", err)
os.Exit(-1)
}
}

@ -15,9 +15,11 @@
package main
import (
"fmt"
"github.com/openimsdk/open-im-server/v3/internal/rpc/conversation"
"github.com/openimsdk/open-im-server/v3/pkg/common/cmd"
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
"os"
)
func main() {
@ -28,6 +30,7 @@ func main() {
panic(err.Error())
}
if err := rpcCmd.StartSvr(config.Config.RpcRegisterName.OpenImConversationName, conversation.Start); err != nil {
panic(err.Error())
fmt.Fprintf(os.Stderr, "\n\nexit -1: \n%+v\n\n", err)
os.Exit(-1)
}
}

@ -15,9 +15,11 @@
package main
import (
"fmt"
"github.com/openimsdk/open-im-server/v3/internal/rpc/friend"
"github.com/openimsdk/open-im-server/v3/pkg/common/cmd"
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
"os"
)
func main() {
@ -28,6 +30,7 @@ func main() {
panic(err.Error())
}
if err := rpcCmd.StartSvr(config.Config.RpcRegisterName.OpenImFriendName, friend.Start); err != nil {
panic(err.Error())
fmt.Fprintf(os.Stderr, "\n\nexit -1: \n%+v\n\n", err)
os.Exit(-1)
}
}

@ -15,9 +15,11 @@
package main
import (
"fmt"
"github.com/openimsdk/open-im-server/v3/internal/rpc/group"
"github.com/openimsdk/open-im-server/v3/pkg/common/cmd"
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
"os"
)
func main() {
@ -28,6 +30,7 @@ func main() {
panic(err.Error())
}
if err := rpcCmd.StartSvr(config.Config.RpcRegisterName.OpenImGroupName, group.Start); err != nil {
panic(err.Error())
fmt.Fprintf(os.Stderr, "\n\nexit -1: \n%+v\n\n", err)
os.Exit(-1)
}
}

@ -15,9 +15,11 @@
package main
import (
"fmt"
"github.com/openimsdk/open-im-server/v3/internal/rpc/msg"
"github.com/openimsdk/open-im-server/v3/pkg/common/cmd"
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
"os"
)
func main() {
@ -28,6 +30,7 @@ func main() {
panic(err.Error())
}
if err := rpcCmd.StartSvr(config.Config.RpcRegisterName.OpenImMsgName, msg.Start); err != nil {
panic(err.Error())
fmt.Fprintf(os.Stderr, "\n\nexit -1: \n%+v\n\n", err)
os.Exit(-1)
}
}

@ -15,9 +15,11 @@
package main
import (
"fmt"
"github.com/openimsdk/open-im-server/v3/internal/rpc/third"
"github.com/openimsdk/open-im-server/v3/pkg/common/cmd"
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
"os"
)
func main() {
@ -28,6 +30,7 @@ func main() {
panic(err.Error())
}
if err := rpcCmd.StartSvr(config.Config.RpcRegisterName.OpenImThirdName, third.Start); err != nil {
panic(err.Error())
fmt.Fprintf(os.Stderr, "\n\nexit -1: \n%+v\n\n", err)
os.Exit(-1)
}
}

@ -15,9 +15,11 @@
package main
import (
"fmt"
"github.com/openimsdk/open-im-server/v3/internal/rpc/user"
"github.com/openimsdk/open-im-server/v3/pkg/common/cmd"
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
"os"
)
func main() {
@ -28,6 +30,7 @@ func main() {
panic(err.Error())
}
if err := rpcCmd.StartSvr(config.Config.RpcRegisterName.OpenImUserName, user.Start); err != nil {
panic(err.Error())
fmt.Fprintf(os.Stderr, "\n\nexit -1: \n%+v\n\n", err)
os.Exit(-1)
}
}

@ -96,7 +96,7 @@ func Start(
err = rpcFn(client, srv)
if err != nil {
return errs.Wrap(err)
return err
}
err = client.Register(
rpcRegisterName,

Loading…
Cancel
Save