From bafaad97e69d0df47236af152e198f701716ac84 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Thu, 2 May 2019 22:18:16 +0200 Subject: [PATCH] clean: request param now uses internal const error 'cerr' --- api/request.param.go | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/api/request.param.go b/api/request.param.go index 57854b2..ae1073c 100644 --- a/api/request.param.go +++ b/api/request.param.go @@ -2,21 +2,15 @@ package api import ( "fmt" + + "git.xdrm.io/go/aicra/internal/cerr" ) -// ConstError is a wrapper to set constant errors -type ConstError string - -// Error implements error -func (err ConstError) Error() string { - return string(err) -} - // ErrReqParamNotFound is thrown when a request parameter is not found -const ErrReqParamNotFound = ConstError("request parameter not found") +const ErrReqParamNotFound = cerr.Error("request parameter not found") // ErrReqParamNotType is thrown when a request parameter is not asked with the right type -const ErrReqParamNotType = ConstError("request parameter does not fulfills type") +const ErrReqParamNotType = cerr.Error("request parameter does not fulfills type") // RequestParam defines input parameters of an api request type RequestParam map[string]interface{}