RIC-475 - E2M E2T init unit tests
[ric-plt/e2mgr.git] / E2Manager / e2managererrors / wrong_state_error.go
index 4c53b2e..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(state string) *WrongStateError {
+func NewWrongStateError(activityName string, state string) *WrongStateError {
        return &WrongStateError{
-               BaseError{
+               &BaseError{
                        Code:    403,
-                       Message: fmt.Sprintf("The RAN state <%s> isn’t in the appropriate state.", 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
 }