First commit
This commit is contained in:
26
setup/e2mgr/E2Manager/e2managererrors/base_error.go
Normal file
26
setup/e2mgr/E2Manager/e2managererrors/base_error.go
Normal file
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// Copyright 2019 AT&T Intellectual Property
|
||||
// Copyright 2019 Nokia
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// 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
|
||||
|
||||
type BaseError struct {
|
||||
Code int
|
||||
Message string
|
||||
}
|
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// Copyright 2019 AT&T Intellectual Property
|
||||
// Copyright 2019 Nokia
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// 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
|
||||
|
||||
type CommandAlreadyInProgressError struct {
|
||||
*BaseError
|
||||
}
|
||||
|
||||
func NewCommandAlreadyInProgressError() *CommandAlreadyInProgressError {
|
||||
return &CommandAlreadyInProgressError {
|
||||
&BaseError{
|
||||
Code: 405,
|
||||
Message: "Command already in progress",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (e *CommandAlreadyInProgressError) Error() string {
|
||||
return e.Message
|
||||
}
|
||||
|
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// Copyright 2019 AT&T Intellectual Property
|
||||
// Copyright 2019 Nokia
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// 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
|
||||
|
||||
type E2TInstanceAbsenceError struct {
|
||||
*BaseError
|
||||
}
|
||||
|
||||
func NewE2TInstanceAbsenceError() *E2TInstanceAbsenceError {
|
||||
return &E2TInstanceAbsenceError{
|
||||
&BaseError{
|
||||
Code: 510,
|
||||
Message: "The New RAN can't be added, please try later.",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (e *E2TInstanceAbsenceError) Error() string {
|
||||
return e.Message
|
||||
}
|
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// Copyright 2019 AT&T Intellectual Property
|
||||
// Copyright 2019 Nokia
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// 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
|
||||
|
||||
type HeaderValidationError struct {
|
||||
*BaseError
|
||||
}
|
||||
|
||||
func NewHeaderValidationError() *HeaderValidationError {
|
||||
return &HeaderValidationError {
|
||||
&BaseError{
|
||||
Code: 415,
|
||||
Message: "Header validation error",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (e *HeaderValidationError) Error() string {
|
||||
return e.Message
|
||||
}
|
38
setup/e2mgr/E2Manager/e2managererrors/internal_error.go
Normal file
38
setup/e2mgr/E2Manager/e2managererrors/internal_error.go
Normal file
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// Copyright 2019 AT&T Intellectual Property
|
||||
// Copyright 2019 Nokia
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// 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
|
||||
|
||||
type InternalError struct {
|
||||
*BaseError
|
||||
}
|
||||
|
||||
func NewInternalError() *InternalError {
|
||||
return &InternalError {
|
||||
&BaseError{
|
||||
Code: 501,
|
||||
Message: "Internal Server Error. Please try again later",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (e *InternalError) Error() string {
|
||||
return e.Message
|
||||
}
|
40
setup/e2mgr/E2Manager/e2managererrors/invalid_json_error.go
Normal file
40
setup/e2mgr/E2Manager/e2managererrors/invalid_json_error.go
Normal file
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// Copyright 2019 AT&T Intellectual Property
|
||||
// Copyright 2019 Nokia
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// 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
|
||||
|
||||
|
||||
type InvalidJsonError struct {
|
||||
*BaseError
|
||||
}
|
||||
|
||||
func NewInvalidJsonError() *InvalidJsonError {
|
||||
return &InvalidJsonError{
|
||||
&BaseError{
|
||||
Code: 401,
|
||||
Message: "corrupted json",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (e *InvalidJsonError) Error() string {
|
||||
return e.Message
|
||||
}
|
||||
|
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// Copyright 2019 AT&T Intellectual Property
|
||||
// Copyright 2019 Nokia
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// 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
|
||||
|
||||
type RequestValidationError struct {
|
||||
*BaseError
|
||||
}
|
||||
|
||||
func NewRequestValidationError() *RequestValidationError {
|
||||
return &RequestValidationError{
|
||||
&BaseError{
|
||||
Code: 402,
|
||||
Message: "Validation error",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (e *RequestValidationError) Error() string {
|
||||
return e.Message
|
||||
}
|
38
setup/e2mgr/E2Manager/e2managererrors/resource_not_found.go
Normal file
38
setup/e2mgr/E2Manager/e2managererrors/resource_not_found.go
Normal file
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// Copyright 2019 AT&T Intellectual Property
|
||||
// Copyright 2019 Nokia
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// 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
|
||||
|
||||
type ResourceNotFoundError struct {
|
||||
*BaseError
|
||||
}
|
||||
|
||||
func NewResourceNotFoundError() *ResourceNotFoundError {
|
||||
return &ResourceNotFoundError{
|
||||
&BaseError{
|
||||
Code: 404,
|
||||
Message: "Resource not found",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (e *ResourceNotFoundError) Error() string {
|
||||
return e.Message
|
||||
}
|
38
setup/e2mgr/E2Manager/e2managererrors/rmr_error.go
Normal file
38
setup/e2mgr/E2Manager/e2managererrors/rmr_error.go
Normal file
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// Copyright 2019 AT&T Intellectual Property
|
||||
// Copyright 2019 Nokia
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// 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
|
||||
|
||||
type RmrError struct {
|
||||
*BaseError
|
||||
}
|
||||
|
||||
func NewRmrError() *RmrError {
|
||||
return &RmrError{
|
||||
&BaseError{
|
||||
Code: 502,
|
||||
Message: "RMR error",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (e *RmrError) Error() string {
|
||||
return e.Message
|
||||
}
|
38
setup/e2mgr/E2Manager/e2managererrors/rnib_db_error.go
Normal file
38
setup/e2mgr/E2Manager/e2managererrors/rnib_db_error.go
Normal file
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// Copyright 2019 AT&T Intellectual Property
|
||||
// Copyright 2019 Nokia
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// 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
|
||||
|
||||
type RnibDbError struct {
|
||||
*BaseError
|
||||
}
|
||||
|
||||
func NewRnibDbError() *RnibDbError {
|
||||
return &RnibDbError {
|
||||
&BaseError{
|
||||
Code: 500,
|
||||
Message: "RNIB error",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (e *RnibDbError) Error() string {
|
||||
return e.Message
|
||||
}
|
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// Copyright 2019 AT&T Intellectual Property
|
||||
// Copyright 2019 Nokia
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// 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
|
||||
|
||||
type RoutingManagerError struct {
|
||||
*BaseError
|
||||
}
|
||||
|
||||
func NewRoutingManagerError() *RoutingManagerError {
|
||||
return &RoutingManagerError{
|
||||
&BaseError{
|
||||
Code: 511,
|
||||
Message: "No Routing Manager Available",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (e *RoutingManagerError) Error() string {
|
||||
return e.Message
|
||||
}
|
40
setup/e2mgr/E2Manager/e2managererrors/wrong_state_error.go
Normal file
40
setup/e2mgr/E2Manager/e2managererrors/wrong_state_error.go
Normal file
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// Copyright 2019 AT&T Intellectual Property
|
||||
// Copyright 2019 Nokia
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// 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 {
|
||||
*BaseError
|
||||
}
|
||||
|
||||
func NewWrongStateError(activityName string, state string) *WrongStateError {
|
||||
return &WrongStateError{
|
||||
&BaseError{
|
||||
Code: 403,
|
||||
Message: fmt.Sprintf("Activity %s rejected. RAN current state %s does not allow its execution ", activityName, state) ,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (e *WrongStateError) Error() string {
|
||||
return e.Message
|
||||
}
|
Reference in New Issue
Block a user