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
insidegetForm
instead ofrender!("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