help > RE: pull request: conn.m, catching errors
Aug 14, 2017  03:08 PM | Shady El Damaty - Georgetown University
RE: pull request: conn.m, catching errors
ah perfect - ok will give it a try :)
Originally posted by Alfonso Nieto-Castanon:
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

Threaded View

TitleAuthorDate
Shady El Damaty Aug 11, 2017
Alfonso Nieto-Castanon Aug 12, 2017
Christelle van Antwerpen Aug 18, 2017
Alfonso Nieto-Castanon Aug 19, 2017
suzanneavery Oct 20, 2017
suzanneavery Oct 20, 2017
amymargolis Aug 16, 2017
RE: pull request: conn.m, catching errors
Shady El Damaty Aug 14, 2017