RejectedSoftware Forums

Sign up

Can't get errorDisplay work

@rootPathFromName
interface API
{

    @path("mytrack")           @method(HTTPMethod.GET)    void postForm(string name); 
}

class MyRouter : API
{
   Config config;
   Database database;
   this(Config config, Database database)
   {
    this.config = config;
    this.database = database;
   }



    void getForm(string _error = null)
    {
        render!("index.dt", _error);
    }

    @errorDisplay!getForm
    void postForm(string name)
    {
        if (name.length == 0)
            throw new Exception("Name must not be empty");
        redirect("/");
    }


}

The vibed 0.8.0-beta6 is going down after access to next URL http://127.0.0.1:8080/api/mytrack?name=foo with error:

CoreTaskFiber was terminated unexpectedly: Access Violation
Program exited with code -1

What I am doing wrong?

Can I do writeln inside getForm instead of render!("index.dt", _error);?

Re: Can't get errorDisplay work

Can I do writeln inside getForm instead of render!("index.dt", _error);?

Have you tried it?

Re: Can't get errorDisplay work

On Tue, 30 May 2017 12:15:32 GMT, Jan Malmstrom wrote:

Can I do writeln inside getForm instead of render!("index.dt", _error);?

Have you tried it?

Yes, the post is result ot my attemptes to get it work.

Re: Can't get errorDisplay work

Am 30.05.2017 um 13:39 schrieb Suliman:

@rootPathFromName
interface API
{

     @path("mytrack")           @method(HTTPMethod.GET)    void postForm(string name);
}

class MyRouter : API
{
    Config config;
    Database database;
    this(Config config, Database database)
    {
     this.config = config;
     this.database = database;
    }



     void getForm(string _error = null)
     {
         render!("index.dt", _error);
     }

     @errorDisplay!getForm
     void postForm(string name)
     {
         if (name.length == 0)
             throw new Exception("Name must not be empty");
         redirect("/");
     }


}

The vibed 0.8.0-beta6 is going down after access to next URL http://127.0.0.1:8080/api/mytrack?name=foo with error:

CoreTaskFiber was terminated unexpectedly: Access Violation
Program exited with code -1

What I am doing wrong?

Can I do writeln inside getForm instead of render!("index.dt", _error);?

Can you run this in a debugger (e.g. through VisualD) to see where the
access violation actually happens? The code above doesn't look
suspicious, and since I have this running in similar form, my first
guess would be that the issue lies somewhere else than in the
@errorDisplay logic itself.

Re: Can't get errorDisplay work

On Tue, 30 May 2017 15:16:13 +0200, Sönke Ludwig wrote:

Am 30.05.2017 um 13:39 schrieb Suliman:

@rootPathFromName
interface API
{

     @path("mytrack")           @method(HTTPMethod.GET)    void postForm(string name);
}

class MyRouter : API
{
    Config config;
    Database database;
    this(Config config, Database database)
    {
     this.config = config;
     this.database = database;
    }



     void getForm(string _error = null)
     {
         render!("index.dt", _error);
     }

     @errorDisplay!getForm
     void postForm(string name)
     {
         if (name.length == 0)
             throw new Exception("Name must not be empty");
         redirect("/");
     }


}

The vibed 0.8.0-beta6 is going down after access to next URL http://127.0.0.1:8080/api/mytrack?name=foo with error:

CoreTaskFiber was terminated unexpectedly: Access Violation
Program exited with code -1

What I am doing wrong?

Can I do writeln inside getForm instead of render!("index.dt", _error);?

Can you run this in a debugger (e.g. through VisualD) to see where the
access violation actually happens? The code above doesn't look
suspicious, and since I have this running in similar form, my first
guess would be that the issue lies somewhere else than in the
@errorDisplay logic itself.

I do not have Visual Studio :(
Here is my full (4KB) project http://rgho.st/7Pst6G7XQ

Re: Can't get errorDisplay work

I posted ready to use example on GIT
https://github.com/bubnenkoff/vibed-issue

The issue in:

void myerror(string _error = null) // it seems that it's even do not calls