ghosttrap-cli 0.3.22__tar.gz → 0.3.24__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ghosttrap_cli-0.3.22 → ghosttrap_cli-0.3.24}/PKG-INFO +1 -1
- {ghosttrap_cli-0.3.22 → ghosttrap_cli-0.3.24}/ghosttrap_cli/cli.py +18 -4
- {ghosttrap_cli-0.3.22 → ghosttrap_cli-0.3.24}/ghosttrap_cli.egg-info/PKG-INFO +1 -1
- {ghosttrap_cli-0.3.22 → ghosttrap_cli-0.3.24}/pyproject.toml +1 -1
- {ghosttrap_cli-0.3.22 → ghosttrap_cli-0.3.24}/README.md +0 -0
- {ghosttrap_cli-0.3.22 → ghosttrap_cli-0.3.24}/ghosttrap_cli/__init__.py +0 -0
- {ghosttrap_cli-0.3.22 → ghosttrap_cli-0.3.24}/ghosttrap_cli.egg-info/SOURCES.txt +0 -0
- {ghosttrap_cli-0.3.22 → ghosttrap_cli-0.3.24}/ghosttrap_cli.egg-info/dependency_links.txt +0 -0
- {ghosttrap_cli-0.3.22 → ghosttrap_cli-0.3.24}/ghosttrap_cli.egg-info/entry_points.txt +0 -0
- {ghosttrap_cli-0.3.22 → ghosttrap_cli-0.3.24}/ghosttrap_cli.egg-info/requires.txt +0 -0
- {ghosttrap_cli-0.3.22 → ghosttrap_cli-0.3.24}/ghosttrap_cli.egg-info/top_level.txt +0 -0
- {ghosttrap_cli-0.3.22 → ghosttrap_cli-0.3.24}/setup.cfg +0 -0
|
@@ -27,7 +27,7 @@ def _harden_signals():
|
|
|
27
27
|
except (OSError, ValueError):
|
|
28
28
|
pass
|
|
29
29
|
|
|
30
|
-
__version__ = "0.3.
|
|
30
|
+
__version__ = "0.3.24"
|
|
31
31
|
|
|
32
32
|
GHOSTTRAP_SERVER = "wss://ghosttrap.io/stream/"
|
|
33
33
|
CONFIG_DIR = os.path.expanduser("~/.ghosttrap")
|
|
@@ -82,6 +82,10 @@ Read `~/.ghosttrap/config.json` for state. It contains:
|
|
|
82
82
|
|
|
83
83
|
For caught exceptions or non-exception conditions the user explicitly wants reported, use `ghosttrap.trap(exc_or_message)` from app code — pass an exception instance or a string. Synthetic string events arrive as type `TrappedEvent` with the caller's stack. Only wire this in when the user asks for it; don't add `trap()` calls speculatively.
|
|
84
84
|
|
|
85
|
+
## Browser errors
|
|
86
|
+
|
|
87
|
+
If the user wants browser-side JavaScript errors captured (often described as "console errors that never reach ghosttrap"), the SDK's Django integration ships a same-origin relay (ghosttrap-sdk >= 0.4.6). Wire it in only when asked: add `path("ghosttrap/", include("ghosttrap.django.urls"))` to the root URLconf and `<script src="{% static 'ghosttrap/ghosttrap.js' %}" defer></script>` to the base template. Browser events then arrive like any other error — JS error type, page URL in the traceback header, JS stack as frames (minified if the app's bundles are; there is no source-map support).
|
|
88
|
+
|
|
85
89
|
## When peek returns
|
|
86
90
|
|
|
87
91
|
1. **Immediately restart peek** in the background before doing anything else — this ensures you're listening for the next error while you work on the current one. Use plain `ghosttrap peek` here (no `--clear`) — you only want to skip backlog at session start.
|
|
@@ -237,12 +241,22 @@ def _get_repo_entry(config, requested=None):
|
|
|
237
241
|
for k, entry in repos.items():
|
|
238
242
|
if f"{entry.get('owner')}/{entry.get('name')}" == cwd_repo:
|
|
239
243
|
return k, entry
|
|
240
|
-
|
|
241
|
-
|
|
244
|
+
if cwd_repo:
|
|
245
|
+
print(f"error: {cwd_repo} is not in your config. run 'ghosttrap setup' to claim it, or pass --repo owner/name.", file=sys.stderr)
|
|
246
|
+
else:
|
|
247
|
+
print("error: not inside a git repo with a github remote, and no --repo given.", file=sys.stderr)
|
|
248
|
+
available = sorted(
|
|
249
|
+
f"{e.get('owner')}/{e.get('name')}"
|
|
250
|
+
for e in repos.values()
|
|
251
|
+
if e.get('owner') and e.get('name')
|
|
252
|
+
)
|
|
253
|
+
if available:
|
|
254
|
+
print(f"available: {', '.join(available)}", file=sys.stderr)
|
|
255
|
+
sys.exit(1)
|
|
242
256
|
|
|
243
257
|
|
|
244
258
|
def _get_repo_token(config, requested=None):
|
|
245
|
-
"""Get the repo token. If `requested` is 'owner/name', match strictly. Else cwd, else
|
|
259
|
+
"""Get the repo token. If `requested` is 'owner/name', match strictly. Else cwd, else error out."""
|
|
246
260
|
_, entry = _get_repo_entry(config, requested)
|
|
247
261
|
return entry["token"]
|
|
248
262
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|