Skip to content

Commit e65b1f9

Browse files
Added samples handle-exception
1 parent 309b440 commit e65b1f9

File tree

6 files changed

+901
-1
lines changed

6 files changed

+901
-1
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,4 @@ __recovery/
6565
# Castalia statistics file (since XE7 Castalia is distributed with Delphi)
6666
*.stat
6767

68-
/modules
68+
modules/

samples/boss-lock.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"hash": "6ef9161b900632671022358216c7dfe7",
3+
"updated": "2019-10-15T22:07:14.0506259-03:00",
4+
"installedModules": {
5+
"github.com/hashload/handle-exception": {
6+
"name": "handle-exception",
7+
"version": "0.1.2",
8+
"hash": "519df8be252fbda605e46bef8d604915",
9+
"artifacts": {},
10+
"failed": false,
11+
"changed": false
12+
},
13+
"github.com/hashload/horse": {
14+
"name": "horse",
15+
"version": "1.6.8",
16+
"hash": "7a0b2394ac49dbd1a62f6d1021cac5b9",
17+
"artifacts": {},
18+
"failed": false,
19+
"changed": false
20+
},
21+
"github.com/hashload/jhonson": {
22+
"name": "jhonson",
23+
"version": "1.0.3",
24+
"hash": "334dfe6b2e7daa4cb6af5b1bf88ec76e",
25+
"artifacts": {},
26+
"failed": false,
27+
"changed": false
28+
}
29+
}
30+
}

samples/boss.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "samples",
3+
"description": "",
4+
"version": "1.0.0",
5+
"homepage": "",
6+
"mainsrc": "./",
7+
"projects": [],
8+
"dependencies": {
9+
"github.com/HashLoad/handle-exception": "^0.1.2",
10+
"github.com/HashLoad/horse": "^1.6.8",
11+
"github.com/hashload/jhonson": "^1.0.3"
12+
}
13+
}

samples/samples.dpr

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
program samples;
2+
3+
{$APPTYPE CONSOLE}
4+
5+
uses
6+
Horse,
7+
Horse.Jhonson,
8+
Horse.HandleException,
9+
System.SysUtils;
10+
11+
{$R *.res}
12+
13+
var
14+
App: THorse;
15+
16+
begin
17+
App := THorse.Create(9000);
18+
19+
App.Use(Jhonson);
20+
App.Use(HandleException);
21+
22+
App.Get('ping',
23+
procedure(Req: THorseRequest; Res: THorseResponse; Next: TProc)
24+
begin
25+
raise Exception.Create('Meu erro personalizado!');
26+
end);
27+
28+
App.Start;
29+
end.

0 commit comments

Comments
 (0)