Better example code?
@ericzbeard já está trabalhando nisso.
Desde 13/10/2022.
Avaliação
Esta issue ainda não foi avaliada.
Descrição
This could also be misunderstanding, the current example code in the create_handler looks like:
try:
if isinstance(session, SessionProxy):
client = session.client("s3")
# Setting Status to success will signal to cfn that the operation is complete
progress.status = OperationStatus.SUCCESS
except TypeError as e:
# exceptions module lets CloudFormation know the type of failure that occurred
raise exceptions.InternalFailure(f"was not expecting type {e}")
# this can also be done by returning a failed progress event
# return ProgressEvent.failed(HandlerErrorCode.InternalFailure, f"was not expecting type {e}")
return progress
as far as I can see that will never raise a TypeError. So I feel this code will be better to get people started:
if not isinstance(session, SessionProxy):
# exceptions module lets CloudFormation know the type of failure that occurred
raise exceptions.InternalFailure(f"session should be a SessionProxy")
# this can also be done by returning a failed progress event
# return ProgressEvent.failed(HandlerErrorCode.InternalFailure, f"was not expecting type {e}")
# TODO: put code here
# Setting Status to success will signal to cfn that the operation is complete
progress.status = OperationStatus.SUCCESS
return progress
That shows the same concepts, without having that try except increasing indentation.
Even if it would throw that exception, I don't see the added value of replacing that with a custom exception (it makes debugging harder if we do not re-raise the original exception)
If CloudFormation requires the thrown exception to be from the exceptions, this sort of code will lead to pokemon exception handling (gotta catch them all), and converting unknown exceptions to InternlFailure would be better handled in cloudformation-cli-python-lib
- Linguagem predominante
- Python
- Estrelas
- 107
- Forks
- 46
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de aws-cloudformation/cloudformation-cli-python-plugin
-
Support UVAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
-
Repo alive?Aberta
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 20/100
aws-cloudformation/cloudformation-cli-python-plugin#270 · 1 comentário · 1 reação ·
-
Improve docstrings for HooksAberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 45/100
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 35/100
aws-cloudformation/cloudformation-cli-python-plugin#268 · 1 comentário · 2 reações ·
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 35/100
aws-cloudformation/cloudformation-cli-python-plugin#264 · 1 comentário ·
Todas as issues de aws-cloudformation/cloudformation-cli-python-plugin
Issues semelhantes
-
good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
vllm-project/vllm-metal#822 ·
Mantenedores costumam responder em até 1 dia
-
vector-store
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 90/100
mem0ai/mem0#7461 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
[Bug]: chunk_span_bounds and _validated_chunk_spans reject Pydantic models ChunkSpan and AudioFileAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
BasedHardware/omi#19047 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
Mantenedores costumam responder em até 1 dia