pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python-lsp/python-lsp-ruff/commit/30163776ed932f91f415506c769d94ae7187e167

convert exceptions to logging errors · python-lsp/python-lsp-ruff@3016377 · GitHub
Skip to content

Commit 3016377

Browse files
committed
convert exceptions to logging errors
1 parent c0ed81d commit 3016377

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pylsp_ruff/plugin.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ def find_executable(executable) -> List[str]:
497497
if exe_path is not None:
498498
cmd = [exe_path]
499499
else:
500-
raise RuntimeError(f"configured ruff executable not found: {executable!r}")
500+
log.error(f"Configured ruff executable not found: {executable!r}")
501501

502502
# try the python module
503503
if cmd is None:
@@ -511,9 +511,10 @@ def find_executable(executable) -> List[str]:
511511
cmd = [system_exe]
512512

513513
if cmd is None:
514-
raise RuntimeError(
515-
"no suitable ruff invocation could be found (executable, python module)"
514+
log.error(
515+
"No suitable ruff invocation could be found (executable, python module)."
516516
)
517+
cmd = []
517518

518519
return cmd
519520

@@ -557,7 +558,7 @@ def run_ruff(
557558

558559
log.debug(f"Calling {cmd} on '{document_path}'")
559560
p = Popen(cmd, stdin=PIPE, stdout=PIPE)
560-
(stdout, stderr) = p.communicate(document_source.encode())
561+
(stdout, _) = p.communicate(document_source.encode())
561562

562563
if p.returncode != 0:
563564
log.error(f"Ruff returned {p.returncode} != 0")

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy