Media package client error (#3983)
* Add delete container and list tags endpoints to MediaStore * Black reformat * Fixed Lint problems * Check if dictionary was deleted effectively * lint fix * MediaPackageClientError * Lint Fix * Test unknown channel describe * Concatenation Fix * MediaPackage - fix error message Co-authored-by: av <arcovoltaico@gmail.com> Co-authored-by: Bert Blommers <info@bertblommers.nl>
This commit is contained in:
parent
9836985473
commit
ae5653b31d
3 changed files with 38 additions and 4 deletions
|
|
@ -1 +1,13 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from moto.core.exceptions import JsonRESTError
|
||||
|
||||
|
||||
class MediaPackageClientError(JsonRESTError):
|
||||
code = 400
|
||||
|
||||
|
||||
# AWS service exceptions are caught with the underlying botocore exception, ClientError
|
||||
class ClientError(MediaPackageClientError):
|
||||
def __init__(self, error, message):
|
||||
super(ClientError, self).__init__(error, message)
|
||||
|
|
|
|||
|
|
@ -1,8 +1,12 @@
|
|||
from __future__ import unicode_literals
|
||||
from boto3 import Session
|
||||
from moto.core import BaseBackend, BaseModel
|
||||
|
||||
from collections import OrderedDict
|
||||
|
||||
from boto3 import Session
|
||||
|
||||
from moto.core import BaseBackend, BaseModel
|
||||
from .exceptions import ClientError
|
||||
|
||||
|
||||
class Channel(BaseModel):
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
|
@ -97,8 +101,12 @@ class MediaPackageBackend(BaseBackend):
|
|||
return response_channels
|
||||
|
||||
def describe_channel(self, id):
|
||||
channel = self._channels[id]
|
||||
return channel.to_dict()
|
||||
try:
|
||||
channel = self._channels[id]
|
||||
return channel.to_dict()
|
||||
except KeyError:
|
||||
error = "NotFoundException"
|
||||
raise ClientError(error, "channel with id={} not found".format(id))
|
||||
|
||||
def delete_channel(self, id):
|
||||
channel = self._channels[id]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue