Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
dbh_api_brsund_register_centre
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Arild Trygve Aae
dbh_api_brsund_register_centre
Commits
0b3e73fd
Commit
0b3e73fd
authored
Sep 26, 2019
by
Arild Trygve Aae
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tmp versjon
parent
7c431a48
Pipeline
#24024
skipped with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
11 deletions
+36
-11
src/main/java/brsund_hent_data/Dbh_api_brsund_register_centre_App.java
.../brsund_hent_data/Dbh_api_brsund_register_centre_App.java
+36
-11
No files found.
src/main/java/brsund_hent_data/Dbh_api_brsund_register_centre_App.java
View file @
0b3e73fd
...
...
@@ -28,6 +28,8 @@ import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import
org.springframework.boot.Banner
;
import
org.springframework.boot.CommandLineRunner
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.web.client.HttpClientErrorException
;
import
org.springframework.web.client.HttpServerErrorException
;
import
org.springframework.web.client.HttpStatusCodeException
;
import
org.springframework.web.client.RestTemplate
;
...
...
@@ -156,26 +158,49 @@ import org.springframework.web.client.RestTemplate;
}
}
}
catch
(
HttpStatusCodeException
exp
)
{
// TODO Auto-generated catch block
skrivFilException
(
writerFeilLogg
,
soek
,
fileNameFeil
,
exp
);
// e.printStackTrace();
}
catch
(
HttpClientErrorException
ce
)
{
appendToFile
(
ce
,
fileNameFeil
,
soek
);
System
.
out
.
println
(
" Exception failce1: "
+
soek
+
" "
+
ce
.
getMessage
());
// e.printStackTrace();
}
catch
(
HttpServerErrorException
se
)
{
appendToFile
(
se
,
fileNameFeil
,
soek
);
System
.
out
.
println
(
" Exception failse1: "
+
soek
+
" "
+
se
.
getMessage
());
}
catch
(
Exception
e
)
{
appendToFile
(
e
,
fileNameFeil
,
soek
);
System
.
out
.
println
(
" Exception faile1: "
+
soek
+
" "
+
e
.
getMessage
());
}
// System.out.println ("Resultat av søk: " + result);
}
catch
(
Exception
e
)
{
skrivFilException
(
writerFeilLogg
,
soek
,
fileNameFeil
,
e
);
System
.
out
.
println
(
" Exception feil2: "
+
soek
+
" "
+
e
.
getMessage
());
}
catch
(
HttpClientErrorException
ce
)
{
appendToFile
(
ce
,
fileNameFeil
,
soek
);
// skrivFilException(writerFeilLogg, soek, fileNameFeil,e);
System
.
out
.
println
(
" Exception feilce2: "
+
soek
+
" "
+
ce
.
getMessage
());
// e.printStackTrace();
}
catch
(
HttpServerErrorException
se
)
{
appendToFile
(
se
,
fileNameFeil
,
soek
);
// skrivFilException(writerFeilLogg, soek, fileNameFeil,e);
System
.
out
.
println
(
" Exception feilse2: "
+
soek
+
" "
+
se
.
getMessage
());
// e.printStackTrace();
}
catch
(
Exception
e
)
{
appendToFile
(
e
,
fileNameFeil
,
soek
);
// e.printStackTrace();
}
}
}
public
static
void
appendToFile
(
Exception
e
,
String
filename
,
String
soek
)
{
try
{
FileWriter
fstream
=
new
FileWriter
(
filename
,
true
);
BufferedWriter
out
=
new
BufferedWriter
(
fstream
);
PrintWriter
pWriter
=
new
PrintWriter
(
out
,
true
);
e
.
printStackTrace
(
pWriter
);
}
catch
(
Exception
ie
)
{
throw
new
RuntimeException
(
"Could not write Exception to file"
,
ie
);
}
}
void
skrivFil
(
BufferedWriter
writer
,
JSONObject
jsonObject
,
String
filename
)
{
...
...
@@ -196,7 +221,7 @@ import org.springframework.web.client.RestTemplate;
System
.
out
.
println
(
"Hei 1 "
+
streng
);
// writer2.append(streng);
// writer2.newLine();
FileWriter
fstream
=
new
FileWriter
(
filename
,
);
FileWriter
fstream
=
new
FileWriter
(
filename
);
BufferedWriter
out
=
new
BufferedWriter
(
fstream
);
PrintWriter
pWriter
=
new
PrintWriter
(
out
,
true
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment