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

VIRA-252: ViraReport throws unhandled exception when issue not found #52

Open
chinwobble opened this issue Feb 23, 2021 · 6 comments
Open
Labels
enhancement New feature or request

Comments

@chinwobble
Copy link
Collaborator

chinwobble commented Feb 23, 2021

branch dev

steps to repro

let g:vira_active_issue = "ABC-1234"
ViraReport

if the JIRA ABC-1234 is not found in your server, it print a stacktrace to the current buffer.
It should just return an error message at the bottom.

@n0v1c3
Copy link
Owner

n0v1c3 commented Feb 23, 2021

I think you did this one just to try and catch me!

@chinwobble chinwobble changed the title ViraReport throws unhandled exception when issue not founding ViraReport throws unhandled exception when issue not found Feb 24, 2021
@n0v1c3
Copy link
Owner

n0v1c3 commented Feb 24, 2021

I do already have a function in autoload/vira.vim for error_msg(code, msg) I also have a concept for it just no plan as of you. I do believe the first proper step for an error guide would be a CATEGORY breakdown, Organization and then displays.

I believe I even started to adjust this error message preemptively for out async tasks and then this cam up. It may not be the same on dev right now.

Sadly display is done but that was the only truly easy part.

@n0v1c3
Copy link
Owner

n0v1c3 commented Feb 25, 2021

Current Idea:

  • Error message.
  • "Stay" on/in current (Null if not chosen).
  • Null leads to select issue menu.
  • FUTURE and off topic, add history to personal reports visited. (50% of the concept is in the code just not smooth).

@n0v1c3 n0v1c3 added the enhancement New feature or request label Feb 27, 2021
@n0v1c3 n0v1c3 changed the title ViraReport throws unhandled exception when issue not found VIRA-252: ViraReport throws unhandled exception when issue not found Feb 27, 2021
@n0v1c3
Copy link
Owner

n0v1c3 commented Feb 28, 2021

function! vira#_select() "{{{2
  let current_pos = getpos('.')
  let value = vira#_getter()

  if expand('%:t') == 'vira_report'
      let issueTest = substitute(substitute(value,'(','','g'),')','','g')
      let issueTest = substitute(substitute(issueTest,'[','','g'),']','','g')
      let issueTest = substitute(substitute(issueTest,'{','','g'),'}','','g')
      let issueTest = substitute(issueTest,'','','g')
    silent! if execute('python3 Vira.api.jira.search_issues("issue = ' . issueTest . '")') == ''
      let g:vira_active_issue = issueTest
      call vira#_menu('report')
    else
      call vira#_browse(expand('<cWORD>'))
    endif
  else
    call vira#_filter_load()
    if s:vira_highlight != '' && stridx(s:vira_highlight, '|' . value . '|') < 0
      if s:vira_menu_type == 'assign_issue' || s:vira_menu_type == 'epic' || s:vira_menu_type == 'issuetype' || s:vira_menu_type == 'set_status' || s:vira_menu_type == 'priority' || s:vira_menu_type == 'epic' || s:vira_menu_type == 'issues' || s:vira_menu_type == 'servers'
        let s:vira_highlight = '|' . value . '|'
      else | let s:vira_highlight = s:vira_highlight . value . '|' | endif
    elseif s:vira_highlight == ''
      let s:vira_highlight = '|' . value . '|'
    endif
    call vira#_highlight()
    call setpos('.', current_pos)
  endif
endfunction

@n0v1c3
Copy link
Owner

n0v1c3 commented Feb 28, 2021

Pretty sure I will need to start with that if statement.

@n0v1c3
Copy link
Owner

n0v1c3 commented Mar 28, 2021

A note for myself and some feedback.

Multiple servers may be possible to check. Start with the one you are in then go down the list. Then fail.

The db has a note for this already in my private notes as we will be able to find where that issue is without changing servers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants