6,902 matches across 25 files for error
snippet_mode: grep · sorted by relevance
105
106 def bad_code(inputs) -> int:
107▶ raise NotImplementedError('For demo purpose')
108
109 chain = RunnableLambda(bad_code)
· · ·
111 - type: textarea
112 attributes:
113▶ label: Error Message and Stack Trace (if applicable)
114 description: |
115 If you are reporting an error, please copy and paste the full error message and
· · ·
115▶ If you are reporting an error, please copy and paste the full error message and
116 stack trace.
117 (This will be automatically formatted into code, so no need for backticks.)
· · ·
122 label: Description
123 description: |
124▶ What is the problem, question, or error?
125
126 Write a short description telling what you are doing, what you expect to happen, and what is currently happening.
16
17 - Examples:
18▶ - fix(anthropic): resolve flag parsing error
19 - feat(core): add multi-tenant support
20 - test(openai): update API usage tests
236 dirs = [d for d in VCR_PACKAGES if d in all_affected]
237 else:
238▶ raise ValueError(f"Unknown job: {job}")
239
240 return [
· · ·
254
255 Raises:
256▶ ValueError: If a single argument looks like JSON but is not a string array.
257 """
258 if len(args) != 1:
· · ·
265 try:
266 parsed = json.loads(value)
267▶ except json.JSONDecodeError as e:
268 msg = "Expected changed files JSON to be a list of strings."
269 raise ValueError(msg) from e
· · ·
269▶ raise ValueError(msg) from e
270
271 if not isinstance(parsed, list) or not all(
· · ·
273 ):
274 msg = "Expected changed files JSON to be a list of strings."
275▶ raise ValueError(msg)
276 return parsed
277
+ 1 more matches in this file
42
43 Raises:
44▶ ValueError: If the dependency string cannot be parsed.
45 """
46 match = _NAME_RE.match(dep)
· · ·
47 if not match:
48 msg = f"Cannot parse dependency: {dep!r}"
49▶ raise ValueError(msg)
50 name = match.group(1)
51 rest = dep[match.end() :].strip()
· · ·
55 if close == -1:
56 msg = f"Unclosed extras bracket in dependency: {dep!r}"
57▶ raise ValueError(msg)
58 rest = rest[close + 1 :].strip()
59
· · ·
70
71def main(pyproject_path: Path) -> int:
72▶ """Check extras sync and return `0` on pass, `1` on mismatch or parse error."""
73 with pyproject_path.open("rb") as f:
74 data = tomllib.load(f)
· · ·
78 try:
79 name, spec = _parse_dep(dep)
80▶ except ValueError as e:
81 print(f"::error file={pyproject_path}::{e}")
82 return 1
+ 3 more matches in this file
25
26 if "rc" in dep_version_string:
27▶ raise ValueError(
28 f"Dependency {dep_version} has a prerelease version. Please remove this."
29 )
· · ·
32 "allow-prereleases", False
33 ):
34▶ raise ValueError(
35 f"Dependency {dep_version} has allow-prereleases set to true. Please remove this."
36 )
46 Raises:
47 requests.exceptions.RequestException: If PyPI API request fails
48▶ KeyError: If package not found or response format unexpected
49 """
50 pypi_url = f"https://pypi.org/pypi/{package_name}/json"
· · ·
86 if spec_set.contains(version):
87 valid_versions.append(version)
88▶ except ValueError:
89 continue
90
· · ·
183 return version in constraints
184 except Exception as e:
185▶ print(f"Error: {e}")
186 return False
187
13 raw = fs.readFileSync(configPath, 'utf8');
14 } catch (e) {
15▶ throw new Error(`Failed to read ${configPath}: ${e.message}`);
16 }
17 let config;
· · ·
19 config = JSON.parse(raw);
20 } catch (e) {
21▶ throw new Error(`Failed to parse pr-labeler-config.json: ${e.message}`);
22 }
23 const required = [
· · ·
28 const missing = required.filter(k => !(k in config));
29 if (missing.length > 0) {
30▶ throw new Error(`pr-labeler-config.json missing required keys: ${missing.join(', ')}`);
31 }
32 return config;
· · ·
35function init(github, owner, repo, config, core) {
36 if (!core) {
37▶ throw new Error('init() requires a `core` parameter (e.g., from actions/github-script)');
38 }
39 const {
· · ·
105 test = p => re.test(p);
106 } else {
107▶ throw new Error(
108 `fileRules[${i}] (label: "${rule.label}") has no recognized matcher ` +
109 `(expected one of: prefix, suffix, exact, pattern)`
+ 4 more matches in this file
27 # PyYAML (YAML 1.1) parses the bare key `on` as boolean True
28 return data[True]["workflow_dispatch"]["inputs"]["working-directory"]["options"]
29▶ except (KeyError, TypeError) as e:
30 msg = f"Could not find workflow_dispatch options in {workflow}: {e}"
31 raise AssertionError(msg) from e
· · ·
31▶ raise AssertionError(msg) from e
32
33
67
68if __name__ != "__main__":
69▶ raise ImportError("{} should not be used as a module.".format(__name__))
70
71import argparse
· · ·
313 try:
314 cwd = os.path.dirname(os.path.realpath(__file__))
315▶ return Git(cwd=cwd, errors=False).describe().lstrip("v")
316 except Git.Error:
317 return "-".join((version, "unknown"))
· · ·
316▶ except Git.Error:
317 return "-".join((version, "unknown"))
318
· · ·
407
408class Git:
409▶ def __init__(self, workdir=None, gitdir=None, cwd=None, errors=True):
410 self.gitcmd = ["git"]
411 self.errors = errors
· · ·
411▶ self.errors = errors
412 self._proc = None
413 if workdir:
+ 20 more matches in this file
1▶# Validates that a package's integration tests compile without syntax or import errors.
2#
3# (If an integration test fails to compile, it won't run.)
111 resolved="${GITHUB_WORKSPACE}/${CLI_PATH}"
112 if [ ! -d "${resolved}" ]; then
113▶ echo "::error::cli-path '${CLI_PATH}' does not exist at ${resolved}"
114 exit 1
115 fi
· · ·
136 run: |
137 echo "${PROVIDERS_JSON}" | jq -e 'type == "array" and length > 0' > /dev/null || {
138▶ echo "::error::providers input must be a non-empty JSON array"
139 exit 1
140 }
· · ·
141 echo "${PROVIDERS_JSON}" | jq -e 'all(has("provider") and has("data_dir"))' > /dev/null || {
142▶ echo "::error::every entry in providers must have 'provider' and 'data_dir' keys"
143 exit 1
144 }
· · ·
159 --provider "${provider}" \
160 --data-dir "${GITHUB_WORKSPACE}/${data_dir}"; then
161▶ echo "::error::Failed to refresh provider: ${provider}"
162 failed="${failed} ${provider}"
163 fi
· · ·
164 done
165 if [ -n "${failed}" ]; then
166▶ echo "::error::The following providers failed:${failed}"
167 exit 1
168 fi
50 } catch (e) {
51 if (e.status !== 404) {
52▶ throw new Error(`getLabel(${labelName}) failed: ${e.message}`);
53 }
54 try {
· · ·
63 const alreadyExists =
64 createErr.status === 422 &&
65▶ Array.isArray(createErr.errors) &&
66 createErr.errors.some(e => e.code === 'already_exists');
67 if (!alreadyExists) throw createErr;
· · ·
66▶ createErr.errors.some(e => e.code === 'already_exists');
67 if (!alreadyExists) throw createErr;
68 }
48 semver='^[0-9]+\.[0-9]+\.[0-9]+$'
49 if [[ ! "$current" =~ $semver ]]; then
50▶ echo "::error::Could not parse current uv pin from $action_file (got '$current')"
51 exit 1
52 fi
· · ·
53 if [[ ! "$latest" =~ $semver ]]; then
54▶ echo "::error::Unexpected uv tag from GitHub API (got '$latest')"
55 exit 1
56 fi
· · ·
139 action_file=".github/actions/uv_setup/action.yml"
140
141▶ # `grep -c` returns 1 on no-match and 2 on read errors. We want
142 # "no match" surfaced as the explicit count-of-zero check below;
143 # read errors must abort. Capture the exit code separately so
· · ·
143▶ # read errors must abort. Capture the exit code separately so
144 # `set -e` doesn't swallow either case.
145 set +e
· · ·
148 set -e
149 if [ "$before_rc" -gt 1 ]; then
150▶ echo "::error::grep read error on $action_file (exit=$before_rc)"
151 exit 1
152 fi
+ 3 more matches in this file
58 )
59 if [ ${#files[@]} -eq 0 ]; then
60▶ echo "::error::No pyproject.toml files found under libs/"
61 exit 1
62 fi
· · ·
68 done
69 if [ ${#failed[@]} -gt 0 ]; then
70▶ echo "::error::Extras-sync check failed for ${#failed[@]} package(s):"
71 printf '::error:: %s\n' "${failed[@]}"
72 exit 1
· · ·
71▶ printf '::error:: %s\n' "${failed[@]}"
72 exit 1
73 fi
66 run: |
67 if [ -z "${{ steps.app-token.outputs.token }}" ]; then
68▶ echo "::error::GitHub App token generation failed — cannot classify contributor"
69 exit 1
70 fi
9# Examples:
10# feat(core): add multi‐tenant support
11▶# fix(langchain): resolve error
12# docs: update API usage examples
13# docs(openai): update API usage examples
· · ·
72 run: |
73 if [[ "$PR_TITLE" =~ ^[a-z]+\(\)[!]?: ]]; then
74▶ echo "::error::PR title has empty scope parentheses: '$PR_TITLE'"
75 echo "Either remove the parentheses or provide a scope (e.g., 'fix(core): ...')."
76 exit 1
71 // Comment write paths can fail for several reasons that should not
72 // turn this advisory job red on its own: fork PRs run with
73▶ // restricted tokens, secondary rate limits, transient API errors.
74 // Fall back to `core.summary` so a maintainer can paste the
75 // remediation manually. The check still fails — `setFailed` is
· · ·
99 }
100 } catch (commentErr) {
101▶ core.warning(`Could not post sticky comment (fork PR token, rate limit, or transient API error): ${commentErr.message}`);
102 await core.summary
103 .addHeading(summaryHeading)
53 }));
54 } catch (e) {
55▶ throw new Error(
56 `Failed to search for closed PRs to reopen after assigning ${assignee} ` +
57 `to #${issueNumber} (HTTP ${e.status ?? 'unknown'}): ${e.message}`,
· · ·
120 continue;
121 }
122▶ // Transient errors (rate limit, 5xx) should fail the job so
123 // the label is NOT removed and the run can be retried.
124 throw e;
86 const sender = context.payload.sender?.login;
87 if (!sender) {
88▶ throw new Error('Event has no sender — cannot check permissions');
89 }
90 try {
· · ·
105 }
106 const status = e.status ?? 'unknown';
107▶ throw new Error(
108 `Permission check failed for ${sender} (HTTP ${status}): ${e.message}`,
109 );
· · ·
264 console.log(`PR author "${prAuthor}" is NOT assigned to #${num} (assignees: ${assignees.join(', ') || 'none'})`);
265 }
266▶ } catch (error) {
267 if (error.status === 404) {
268 console.log(`Issue #${num} not found — skipping`);
· · ·
267▶ if (error.status === 404) {
268 console.log(`Issue #${num} not found — skipping`);
269 } else {
· · ·
270▶ // Non-404 errors (rate limit, server error) must not be
271 // silently skipped — they could cause false enforcement
272 // (closing a legitimate PR whose assignment can't be verified).
+ 4 more matches in this file
70 # Validate repository format (allow any org with proper format)
71 if [[ ! "$repo" =~ ^[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+$ ]]; then
72▶ echo "Error: Invalid repository format: $repo"
73 exit 1
74 fi
· · ·
78 # Additional validation for repo name
79 if [[ ! "$REPO_NAME" =~ ^[a-zA-Z0-9_.-]+$ ]]; then
80▶ echo "Error: Invalid repository name: $REPO_NAME"
81 exit 1
82 fi
200- [ ] Tests fail when your new logic is broken
201- [ ] Happy path is covered
202▶- [ ] Edge cases and error conditions are tested
203- [ ] Use fixtures/mocks for external dependencies
204- [ ] Tests are deterministic (no flaky tests)
· · ·
208
209- No `eval()`, `exec()`, or `pickle` on user-controlled input
210▶- Proper exception handling (no bare `except:`) and use a `msg` variable for error messages
211- Remove unreachable/commented code before committing
212- Race conditions or resource leaks (file handles, sockets, threads).
· · ·
232
233 Raises:
234▶ InvalidEmailError: If the email address format is invalid.
235 SMTPConnectionError: If unable to connect to email server.
236 """
· · ·
235▶ SMTPConnectionError: If unable to connect to email server.
236 """
237```
200- [ ] Tests fail when your new logic is broken
201- [ ] Happy path is covered
202▶- [ ] Edge cases and error conditions are tested
203- [ ] Use fixtures/mocks for external dependencies
204- [ ] Tests are deterministic (no flaky tests)
· · ·
208
209- No `eval()`, `exec()`, or `pickle` on user-controlled input
210▶- Proper exception handling (no bare `except:`) and use a `msg` variable for error messages
211- Remove unreachable/commented code before committing
212- Race conditions or resource leaks (file handles, sockets, threads).
· · ·
232
233 Raises:
234▶ InvalidEmailError: If the email address format is invalid.
235 SMTPConnectionError: If unable to connect to email server.
236 """
· · ·
235▶ SMTPConnectionError: If unable to connect to email server.
236 """
237```
71
72 Raises:
73▶ AttributeError: If the attribute is not a valid dynamic import.
74 """
75 module_name = _dynamic_imports.get(attr_name)
124 """Finalize the annotation of a class."""
125 # Can't set new_doc on some extension objects.
126▶ with contextlib.suppress(AttributeError):
127 obj.__doc__ = new_doc
128
105 if pending and removal:
106 msg = "A pending deprecation cannot have a scheduled removal"
107▶ raise ValueError(msg)
108 if alternative and alternative_import:
109 msg = "Cannot specify both alternative and alternative_import"
· · ·
110▶ raise ValueError(msg)
111
112 if alternative_import and "." not in alternative_import:
· · ·
115 f" {alternative_import}"
116 )
117▶ raise ValueError(msg)
118
119
· · ·
259 """Finalize the deprecation of a class."""
260 # Can't set new_doc on some extension objects.
261▶ with contextlib.suppress(AttributeError):
262 obj.__doc__ = new_doc
263
· · ·
290 if not _name:
291 msg = f"Field {obj} must have a name to be deprecated."
292▶ raise ValueError(msg)
293 old_doc = obj.description
294
+ 2 more matches in this file
Search syntax
auth login | both terms (AND is implicit) |
auth OR login | either term |
NOT path:vendor | exclude matches |
"exact phrase" | quoted exact match |
/func\s+Test/ | regex |
handler~1 | fuzzy (Levenshtein 1) |
file:*_test.go | filename glob |
path:pkg/auth/** | full path glob |
lang:go | language filter |
Search any public repo from your terminal
This page calls POST /api/v1/code_search. Same tool, available over MCP for Claude/Cursor/Copilot.