Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cli] do not crash when listing unaccessible directories #865

Merged
merged 1 commit into from
Sep 3, 2018

Conversation

mikz
Copy link
Contributor

@mikz mikz commented Sep 3, 2018

When the directory is not accessible, instead of crash like:

lua coroutine: runtime error: /opt/app-root/src/src/apicast/cli/filesystem.lua:50: attempt to call a nil value

Get a debug log like:

 /usr/local/share/lua/5.1/lfs.lua:513: cannot open /usr/local/openresty/nginx/fastcgi_temp : Permission denied

@mikz mikz requested a review from a team as a code owner September 3, 2018 14:31
@@ -13,14 +13,17 @@ local co_yield = coroutine.yield
local co_create = coroutine.create
local co_resume = coroutine.resume

local noop = function (err) end
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused argument 'err'

@mikz mikz force-pushed the cli-filesystem-permission-error branch from b824986 to fd1f8a8 Compare September 3, 2018 14:33
When the directory is not accessible, instead of crash like:

```
lua coroutine: runtime error: /opt/app-root/src/src/apicast/cli/filesystem.lua:50: attempt to call a nil value
```

Get a debug log like:
```
 /usr/local/share/lua/5.1/lfs.lua:513: cannot open /usr/local/openresty/nginx/fastcgi_temp : Permission denied
```
@mikz mikz force-pushed the cli-filesystem-permission-error branch from fd1f8a8 to c52896d Compare September 3, 2018 14:34
@mikz mikz merged commit 945a0d9 into master Sep 3, 2018
@mikz mikz deleted the cli-filesystem-permission-error branch September 3, 2018 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants