ExtraScripts: Allow hooking on errors

Open
#5,193 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
build-system

Research direction

Start by locating the ExtraScripts handling and the upload path, then read how existing actions and errors are dispatched. Compare the proposed env.AddPostAction('error', ...) and env.AddErrorAction('upload', ...) entry points with current APIs; done means error hooks run at the requested scope, including when upload fails, with coverage for both cases.

Written by the indexing model from the issue text.

Description

build system feature

Like in the title, it would be useful in some cases to be able to run code in the case of errors, for example I want to do something before upload, and after - even if the upload fails. Afaik there is no way to fo this currently.

My idea would be to add two entry points:

# run after any error
env.AddPostAction('error', ...)
# or run after specific error
env.AddErrorAction('upload', ...)
Dominant language
Python
Stars
9.6k
Forks
916
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from platformio/platformio-core

All issues in platformio/platformio-core

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.