handle no token when using *
Closed this issue · 1 comments
replicate:
- do not enter github token
- type gr + *
Error:
Please open new issue in: https://github.com/Flow-Launcher/Flow.Launcher/issues/new
- upload log file: C:\Users\JJW\AppData\Local\FlowLauncher-PRD\app-1.0.0\UserData\Logs\1.0.0\2022-01-24.txt
- copy below exception message
Flow Launcher version: 1.0.0
OS Version: Microsoft Windows NT 10.0.19044.0
IntPtr Length: 8
x64: True
Python Path:
Date: 01/24/2022 07:42:13
Exception:
System.IO.InvalidDataException: Github Quick Launcher|Exception ignored in: <function Launcher.del at 0x000001E041C29A60>
Traceback (most recent call last):
File "C:\Users\JJW\AppData\Local\FlowLauncher-PRD\app-1.0.0\UserData\Plugins\Github Quick Launcher-1.1.0\lib\flox\launcher.py", line 59, in del
self.call()
File "C:\Users\JJW\AppData\Local\FlowLauncher-PRD\app-1.0.0\UserData\Plugins\Github Quick Launcher-1.1.0\lib\flox_init_.py", line 96, in call
return super().call()
File "C:\Users\JJW\AppData\Local\FlowLauncher-PRD\app-1.0.0\UserData\Plugins\Github Quick Launcher-1.1.0\lib\flox\launcher.py", line 41, in call
results = request_method(*request_parameters)
File "C:\Users\JJW\AppData\Local\FlowLauncher-PRD\app-1.0.0\UserData\Plugins\Github Quick Launcher-1.1.0\lib\flox_init_.py", line 127, in _query
self.query(query)
File "C:\Users\JJW\AppData\Local\FlowLauncher-PRD\app-1.0.0\UserData\Plugins\Github Quick Launcher-1.1.0\plugin\main.py", line 77, in query
self.results(query, stars, STAR_GLYPH)
File "C:\Users\JJW\AppData\Local\FlowLauncher-PRD\app-1.0.0\UserData\Plugins\Github Quick Launcher-1.1.0\plugin\main.py", line 53, in results
for idx, repo in enumerate(repos):
File "C:\Users\JJW\AppData\Local\FlowLauncher-PRD\app-1.0.0\UserData\Plugins\Github Quick Launcher-1.1.0\lib\github\PaginatedList.py", line 56, in iter
newElements = self._grow()
File "C:\Users\JJW\AppData\Local\FlowLauncher-PRD\app-1.0.0\UserData\Plugins\Github Quick Launcher-1.1.0\lib\github\PaginatedList.py", line 67, in _grow
newElements = self._fetchNextPage()
File "C:\Users\JJW\AppData\Local\FlowLauncher-PRD\app-1.0.0\UserData\Plugins\Github Quick Launcher-1.1.0\lib\github\PaginatedList.py", line 199, in _fetchNextPage
headers, data = self.__requester.requestJsonAndCheck(
File "C:\Users\JJW\AppData\Local\FlowLauncher-PRD\app-1.0.0\UserData\Plugins\Github Quick Launcher-1.1.0\lib\github\Requester.py", line 353, in requestJsonAndCheck
return self.__check(
File "C:\Users\JJW\AppData\Local\FlowLauncher-PRD\app-1.0.0\UserData\Plugins\Github Quick Launcher-1.1.0\lib\github\Requester.py", line 378, in __check
raise self.__createException(status, responseHeaders, output)
github.GithubException.GithubException: 401 {"message": "Requires authentication", "documentation_url": "https://docs.github.com/rest/guides/getting-started-with-the-rest-api#authentication"}
at Flow.Launcher.Core.Plugin.JsonRPCPlugin.ExecuteAsync(ProcessStartInfo startInfo, CancellationToken token) in C:\Workbench\Git\Flow.Launcher\Flow.Launcher.Core\Plugin\JsonRPCPlugin.cs:line 308
at Flow.Launcher.Core.Plugin.JsonRPCPlugin.ExecuteAsync(ProcessStartInfo startInfo, CancellationToken token) in C:\Workbench\Git\Flow.Launcher\Flow.Launcher.Core\Plugin\JsonRPCPlugin.cs:line 308
at Flow.Launcher.Core.Plugin.JsonRPCPlugin.QueryAsync(Query query, CancellationToken token) in C:\Workbench\Git\Flow.Launcher\Flow.Launcher.Core\Plugin\JsonRPCPlugin.cs:line 323
at Flow.Launcher.Core.Plugin.PluginManager.<>c__DisplayClass22_0.<b__0>d.MoveNext() in C:\Workbench\Git\Flow.Launcher\Flow.Launcher.Core\Plugin\PluginManager.cs:line 192
--- End of stack trace from previous location ---
at Flow.Launcher.Infrastructure.Stopwatch.DebugAsync(String message, Func`1 action) in C:\Workbench\Git\Flow.Launcher\Flow.Launcher.Infrastructure\Stopwatch.cs:line 40
at Flow.Launcher.Core.Plugin.PluginManager.QueryForPluginAsync(PluginPair pair, Query query, CancellationToken token) in C:\Workbench\Git\Flow.Launcher\Flow.Launcher.Core\Plugin\PluginManager.cs:line 211
at Flow.Launcher.ViewModel.MainViewModel.<>c__DisplayClass149_0.<g__QueryTask|2>d.MoveNext() in C:\Workbench\Git\Flow.Launcher\Flow.Launcher\ViewModel\MainViewModel.cs:line 654
--- End of stack trace from previous location ---
at Flow.Launcher.ViewModel.MainViewModel.QueryResults() in C:\Workbench\Git\Flow.Launcher\Flow.Launcher\ViewModel\MainViewModel.cs:line 655
at System.Threading.Tasks.Task.<>c.b__140_0(Object state)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
Strange because it should already be handled. I added a fall back to catch the exception and alert the user they need to authenticate to use this API.