RIC-475 - E2M E2T init unit tests
[ric-plt/e2mgr.git] / E2Manager / e2managererrors / wrong_state_error.go
index be7b59a..aadbc52 100644 (file)
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 // See the License for the specific language governing permissions and
 // limitations under the License.
-//
+
+//  This source code is part of the near-RT RIC (RAN Intelligent Controller)
+//  platform project (RICP).
+
 
 package e2managererrors
 
+import "fmt"
+
 type WrongStateError struct {
-       Err BaseError
+       *BaseError
 }
 
-func NewWrongStateError() *RnibDbError {
-       return &RnibDbError{
-               BaseError{
+func NewWrongStateError(activityName string, state string) *WrongStateError {
+       return &WrongStateError{
+               &BaseError{
                        Code:    403,
-                       Message: "RAN in wrong state",
+                       Message: fmt.Sprintf("Activity %s rejected. RAN current state %s does not allow its execution ", activityName, state) ,
                },
        }
 }
 
 func (e *WrongStateError) Error() string {
-       return e.Err.Message
+       return e.Message
 }