help > RE: pull request: conn.m, catching errors
Aug 11, 2017  05:08 PM
Alfonso Nieto-Castanon
McGovern Institute for Brain Research. MIT
RE: pull request: conn.m, catching errors
Hi Shady,

Thanks for the bug report / pull request / help. Your suggestion is very welcome. The error is actually happening inside of CONN's error-handling routines and it is arising because the not-installed-SPM condition is being checked a bit too early (before other CONN initialization routines have had a chance to run). As a more general fix I would suggest perhaps try adding the line:
   if ~isfield(CONN_x,'ver'), CONN_x.ver='undetermined'; end

right before the "[str,PrimaryMessage]=conn_errormessage(me,filename,0,CONN_x.ver);" line in conn.m. That should allow CONN's error-handing routines to take care of this scenario normally. Let me know if that would also seem to work.

Thanks again
Alfonso

Originally posted by Shady El Damaty:
Hello,

Conn isn't git version controlled (as far as I know) so I would like to submit a 'pull request' through the forum.  I noticed a minor bug when launching Conn on a computer without SPM installed.  The splash screen hangs up and a non-descriptive error message pops up in the command window:

    Struct contents reference from a non-struct array object.

    Error in conn (line 8701)
    [str,PrimaryMessage]=conn_errormessage(me,filename,0,CONN_x.ver)
  
I wasn't able to really figure out why Conn wouldn't launch until I spit out the contents of the 'me' variable.  I added the following line 

    error('conn:conn:spminstall',me.message);

on line 8701 of conn.m and now MATLAB prints out an error message telling you exactly what is wrong:

    Error using conn (line 8701)
    INSTALLATION PROBLEM. Please re-install SPM and try again
reply reply with quote
Threaded View
TitleAuthorDate
pull request: conn.m, catching errorsShady El DamatyAug 11, 2017
      RE: pull request: conn.m, catching errorsAlfonso Nieto-CastanonAug 11, 2017
            RE: pull request: conn.m, catching errorsChristelle van AntwerpenAug 18, 2017
                  RE: pull request: conn.m, catching errorsAlfonso Nieto-CastanonAug 18, 2017
                        RE: pull request: conn.m, catching errorssuzanneaveryOct 20, 2017
                              RE: pull request: conn.m, catching errorssuzanneaveryOct 20, 2017
            RE: pull request: conn.m, catching errorsamymargolisAug 16, 2017
            RE: pull request: conn.m, catching errorsShady El DamatyAug 14, 2017