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

out of the box error for command :Wandbox #10

Open
niklasnolte opened this Issue Jun 12, 2018 · 10 comments

Comments

Projects
None yet
4 participants
@niklasnolte

niklasnolte commented Jun 12, 2018

When running :Wandbox on the following code ( only open file in vim 8 ) right after I installed it with vundles PluginInstall, I get the error shown below.

Did I miss some installation instruction?

Arch Linux 4.16.5-1-ARCH
vim 8.1.22

#include <iostream>

int main () {
  std::cout << "hello world" << std::endl;
}
Error detected while processing function wandbox#run_sync_or_async[4]..wandbox#run[4]..wandbox#compile:
line   19:
E605: Exception not caught: Request has failed! Status 0: 
Error detected while processing function wandbox#run_sync_or_async:
line    4:
E171: Missing :endif
@rhysd

This comment has been minimized.

Show comment
Hide comment
@rhysd

rhysd Jun 14, 2018

Owner

I tried it on my machine (macOS 12.11) and I could not see the error.

2018-06-14 13 22 17

This plugin is for a web service. So the service might not work for you. Could you try again now and confirm this issue still occurs?

And if you write some configuration for wandbox-vim in your vimrc, please let me know it.

Owner

rhysd commented Jun 14, 2018

I tried it on my machine (macOS 12.11) and I could not see the error.

2018-06-14 13 22 17

This plugin is for a web service. So the service might not work for you. Could you try again now and confirm this issue still occurs?

And if you write some configuration for wandbox-vim in your vimrc, please let me know it.

@forno

This comment has been minimized.

Show comment
Hide comment
@forno

forno Jun 27, 2018

Hi @rhysd

I have the same problem.
My error message is:

function wandbox#run_sync_or_async[4]..wandbox#run[4]..wandbox#compile の処理中にエラーが検出されました:
行   19:
E605: 例外が捕捉されませんでした: Request has failed! Status 0: 
function wandbox#run_sync_or_async の処理中にエラーが検出されました:
行    4:
E171: :endif がありません

I research this problem's precision with lxc.
The result says Vim8.0 or newer has this problem, maybe.

Here is my experiment result:

The common environment;
vim-package (I put wandbox-vim to .vim/pack/wandbox/start/)
commit# 71c97b1

  1. Fail: My main computer: Ubuntu 18.04 & Vim 8.1.0115
  2. Fail: Ubuntu 18.04 container: Ubuntu18.04 & Vim 8.0.1453
  3. Success: Ubuntu 16.04 container: Ubuntu 16.04 & Vim 7.4.1689 extra 8.0.0056

What do you think for this?

forno commented Jun 27, 2018

Hi @rhysd

I have the same problem.
My error message is:

function wandbox#run_sync_or_async[4]..wandbox#run[4]..wandbox#compile の処理中にエラーが検出されました:
行   19:
E605: 例外が捕捉されませんでした: Request has failed! Status 0: 
function wandbox#run_sync_or_async の処理中にエラーが検出されました:
行    4:
E171: :endif がありません

I research this problem's precision with lxc.
The result says Vim8.0 or newer has this problem, maybe.

Here is my experiment result:

The common environment;
vim-package (I put wandbox-vim to .vim/pack/wandbox/start/)
commit# 71c97b1

  1. Fail: My main computer: Ubuntu 18.04 & Vim 8.1.0115
  2. Fail: Ubuntu 18.04 container: Ubuntu18.04 & Vim 8.0.1453
  3. Success: Ubuntu 16.04 container: Ubuntu 16.04 & Vim 7.4.1689 extra 8.0.0056

What do you think for this?

@niklasnolte

This comment has been minimized.

Show comment
Hide comment
@niklasnolte

niklasnolte Jun 27, 2018

i can still confirm the error, no specialities in .vimrc

niklasnolte commented Jun 27, 2018

i can still confirm the error, no specialities in .vimrc

@forno

This comment has been minimized.

Show comment
Hide comment
@forno

forno Jun 27, 2018

Additional information.

I tryed to remove if ! response.success section on function! wandbox#compile in autoload/wandbox.vim.

I see correct movement.

## clang-head
  Hello world

It say that response.content has correct moving, But response.success and response.status are not working.
I see that vital.http are broken.

wandbox-vim's vital.vim may not support vim 8.x.

forno commented Jun 27, 2018

Additional information.

I tryed to remove if ! response.success section on function! wandbox#compile in autoload/wandbox.vim.

I see correct movement.

## clang-head
  Hello world

It say that response.content has correct moving, But response.success and response.status are not working.
I see that vital.http are broken.

wandbox-vim's vital.vim may not support vim 8.x.

@bsamorodov

This comment has been minimized.

Show comment
Hide comment
@bsamorodov

bsamorodov Jul 12, 2018

I've got the same error using vim via Termux at Android.

bsamorodov commented Jul 12, 2018

I've got the same error using vim via Termux at Android.

@bsamorodov

This comment has been minimized.

Show comment
Hide comment
@bsamorodov

bsamorodov Jul 13, 2018

I'm not sure what's the actual bug is, but the following patch made wandbox act as expected.

diff --git a/autoload/wandbox.vim b/autoload/wandbox.vim
index daf97c3..a08052a 100644
--- a/autoload/wandbox.vim
+++ b/autoload/wandbox.vim
@@ -420,7 +420,7 @@ function! wandbox#compile(code, compiler, options, runtime_options, stdin)
                 \ 'method' : 'POST',
                 \ 'client' : (g:wandbox#disable_python_client ? ['curl', 'wget'] : ['python', 'curl', 'wget']),
                 \ })
-    if ! response.success
+    if response.success != 0
         throw "Request has failed! Status " . response.status . ': ' . response.statusText
     endif
     return s:JSON.decode(response.content)

bsamorodov commented Jul 13, 2018

I'm not sure what's the actual bug is, but the following patch made wandbox act as expected.

diff --git a/autoload/wandbox.vim b/autoload/wandbox.vim
index daf97c3..a08052a 100644
--- a/autoload/wandbox.vim
+++ b/autoload/wandbox.vim
@@ -420,7 +420,7 @@ function! wandbox#compile(code, compiler, options, runtime_options, stdin)
                 \ 'method' : 'POST',
                 \ 'client' : (g:wandbox#disable_python_client ? ['curl', 'wget'] : ['python', 'curl', 'wget']),
                 \ })
-    if ! response.success
+    if response.success != 0
         throw "Request has failed! Status " . response.status . ': ' . response.statusText
     endif
     return s:JSON.decode(response.content)
@rhysd

This comment has been minimized.

Show comment
Hide comment
@rhysd

rhysd Jul 14, 2018

Owner

I'm sorry for catching the comments lately. It's very weird for me that modifying !response.success to response.success != 0 solve this issue since they mean the same in this context... But if really the modification fixes this issue, I'll add it to master.

Owner

rhysd commented Jul 14, 2018

I'm sorry for catching the comments lately. It's very weird for me that modifying !response.success to response.success != 0 solve this issue since they mean the same in this context... But if really the modification fixes this issue, I'll add it to master.

@rhysd

This comment has been minimized.

Show comment
Hide comment
@rhysd

rhysd Jul 14, 2018

Owner

@niklasnolte @forno @bsamorodov I added the modification at 700456e. Could you try?

Owner

rhysd commented Jul 14, 2018

@niklasnolte @forno @bsamorodov I added the modification at 700456e. Could you try?

@forno

This comment has been minimized.

Show comment
Hide comment
@forno

forno Jul 16, 2018

@rhysd
It fixes this problem in every environment.
Thank you!

forno commented Jul 16, 2018

@rhysd
It fixes this problem in every environment.
Thank you!

@forno

This comment has been minimized.

Show comment
Hide comment
@forno

forno Jul 16, 2018

hmm...

I notice broken all others command. ex)WandboxOptionList
The fix makes degradation. Commands were working before the fix.

And this is an important point.
Web.HTTP's response.success means 1 is Success, 0 is Failed.
https://github.com/vim-jp/vital.vim/blob/master/doc/vital/Web/HTTP.txt#L163-L164

So, I think...
On old (or Vim 7.x), vital.vim's Web.HTTP undefine response.success on connection failed.
However, on new (or Vim 8.x), it defines response.success to 0 on connection failed.

Here say that if ! response.success means check to be defined.
It isn't equal if response.success != 0.

I don't know what happens.

  • :Wandbox command's response.success is 0.
  • :WandboxOptionList command's response.success is 1.

What different between them?
It may API problem, I think.

forno commented Jul 16, 2018

hmm...

I notice broken all others command. ex)WandboxOptionList
The fix makes degradation. Commands were working before the fix.

And this is an important point.
Web.HTTP's response.success means 1 is Success, 0 is Failed.
https://github.com/vim-jp/vital.vim/blob/master/doc/vital/Web/HTTP.txt#L163-L164

So, I think...
On old (or Vim 7.x), vital.vim's Web.HTTP undefine response.success on connection failed.
However, on new (or Vim 8.x), it defines response.success to 0 on connection failed.

Here say that if ! response.success means check to be defined.
It isn't equal if response.success != 0.

I don't know what happens.

  • :Wandbox command's response.success is 0.
  • :WandboxOptionList command's response.success is 1.

What different between them?
It may API problem, I think.

rhysd added a commit that referenced this issue Jul 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment