Commit 51cb2f4b authored by AyeshaAyubG's avatar AyeshaAyubG
Browse files

add error handling capabilities in problemDetails in MEC013

parent 99c27e63
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2436,6 +2436,9 @@ components:
          type: string
          x-etsi-mec-cardinality: 0..1
          x-etsi-mec-origin-type: URI
      required:
      - status
      - detail
      type: object
    RetrievalStatus:
      enum:
+9 −0
Original line number Diff line number Diff line
@@ -297,3 +297,12 @@ func convertStringToConnectionType(conType string) ConnectionType {
		return CONTYPE_UNKNOWN
	}
}

func convertProblemDetailstoJson(probdetails *ProblemDetails) string {
	jsonInfo, err := json.Marshal(*probdetails)
	if err != nil {
		log.Println(err.Error())
		return ""
	}
	return string(jsonInfo)
}
 No newline at end of file
+160 −149

File changed.

Preview size limit exceeded, changes collapsed.

+2 −2
Original line number Diff line number Diff line
@@ -25,11 +25,11 @@ package server

type ProblemDetails struct {
	// A human-readable explanation specific to this occurrence of the problem
	Detail string `json:"detail,omitempty"`
	Detail string `json:"detail"`
	// A URI reference that identifies the specific occurrence of the problem
	Instance string `json:"instance,omitempty"`
	// The HTTP status code for this occurrence of the problem
	Status int32 `json:"status,omitempty"`
	Status int32 `json:"status"`
	// A short, human-readable summary of the problem type
	Title string `json:"title,omitempty"`
	// A URI reference according to IETF RFC 3986 that identifies the problem type