MarketingSystemDataExportTool/grpc/platform/platformerr/err.proto

24 lines
944 B
Protocol Buffer
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

syntax = "proto3";
package platformservice.platformerr;
import "errors/errors.proto";
option go_package = "./platformservice/platformerr;platformerr";
// 服务内部定义的错误码
enum Err {
// GRPC项目缺省错误码或显示指定的码必须符合如下链接中定义的http码
// https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto
// 原因此码为http状态码在GRPC服务中输出时会将其转换为grpc的状态码在客户端调用调用返回err时
// 可以使用统一定义生成的err来判断是否是某种错误如IsDbNotFound方法
// 可以看到方法中调用了errors.FromError它会将grpc的状态码转换为http状态码
// 因此需要保证定义的code必须为如上链接中可以相互转换的状态码
option (errors.default_code) = 2;
// 未找到数据
NOT_FOUND_DB = 0;
// 适配器配置信息不合法
CONFIG_INVALID = 1;
}