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

ValueError: Error trying to decode value: Unexpected trailing characters in (data):2:13 #131

Closed
theerror opened this issue Nov 21, 2018 · 2 comments

Comments

@theerror
Copy link

I have strange bug. Whenever I will try inserting TOC, it will produce error in log. But .md file itself is quite simple:

## Salt
Modules https://docs.saltstack.com/en/latest/ref/modules/all/index.html#all-salt-modules

### Commands
salt '*' test.ping
salt '*' cmd.run 'ls -l /etc'

List on active nodes
salt-run manage.up | grep ....

### Telnet alternative
cat < /dev/tcp/188.138.102.31/3306
curl -v telnet://127.0.0.1:22

but after click on InsertTOC, error in console shows up

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 1072, in run_
    return self.run(edit)
  File "/Users/panelacek/Library/Application Support/Sublime Text 3/Installed Packages/MarkdownTOC.sublime-package/markdowntoc/markdowntoc_update.py", line 6, in run
  File "/Users/panelacek/Library/Application Support/Sublime Text 3/Installed Packages/MarkdownTOC.sublime-package/markdowntoc/markdowntoc_insert.py", line 105, in find_tag_and_insert
  File "/Users/panelacek/Library/Application Support/Sublime Text 3/Installed Packages/MarkdownTOC.sublime-package/markdowntoc/base.py", line 26, in log
  File "/Users/panelacek/Library/Application Support/Sublime Text 3/Installed Packages/MarkdownTOC.sublime-package/markdowntoc/base.py", line 17, in settings
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime.py", line 215, in decode_value
    raise ValueError(err)
ValueError: Error trying to decode value: Unexpected trailing characters in (data):2:13

It used to work some time ago and I do not understand, what had happened.

Sublime 3.1.1

@theerror
Copy link
Author

Heh, got it. Somehow the first curl brace disappeared from user config...

So, just tip - maybe could be fine to to do basic syntax check of conf, before use it.

naokazuterada added a commit that referenced this issue Nov 24, 2018
- Catch invalid json errors #131
@naokazuterada
Copy link
Owner

@theerror

Thank you for posting a solution!

3.0.3 will show you errors on console as follows

'MarkdownTOC Error: Invalid json in Packages/User/MarkdownTOC.sublime-settings: Error trying to decode value: Unexpected character, expected a comma or closing bracket in (data):3:17'

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

No branches or pull requests

2 participants