Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Cwa App Android
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Felix Foertsch
Cwa App Android
Commits
5100eba7
Unverified
Commit
5100eba7
authored
4 years ago
by
Matthias Urhahn
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Nicer error messages if a value is missing in an *_environments.json (#2283)
parent
c6289aac
No related branches found
Branches containing commit
Tags
v1.13.0-RC1
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Corona-Warn-App/src/main/java/de/rki/coronawarnapp/environment/EnvironmentSetup.kt
+12
-5
12 additions, 5 deletions
...java/de/rki/coronawarnapp/environment/EnvironmentSetup.kt
with
12 additions
and
5 deletions
Corona-Warn-App/src/main/java/de/rki/coronawarnapp/environment/EnvironmentSetup.kt
+
12
−
5
View file @
5100eba7
...
...
@@ -86,17 +86,24 @@ class EnvironmentSetup @Inject constructor(
val
targetEnvKey
=
if
(
environmentJson
.
has
(
currentEnvironment
.
rawKey
))
{
currentEnvironment
.
rawKey
}
else
{
Timber
.
e
(
"Tried to use unavailable environment:
$variableKey on
$currentEnvironment"
)
Timber
.
e
(
"Tried to use unavailable environment: $currentEnvironment"
)
Type
.
PRODUCTION
.
rawKey
}
environmentJson
val
value
=
environmentJson
.
getAsJsonObject
(
targetEnvKey
)
.
getAsJsonPrimitive
(
variableKey
.
rawKey
)
return
@run
if
(
value
!=
null
)
{
Timber
.
v
(
"getEnvironmentValue(endpoint=%s): %s"
,
variableKey
,
value
)
value
}
else
{
throw
IllegalStateException
(
"$currentEnvironment:$variableKey is missing in your *_environment.json"
)
}
}
catch
(
e
:
Exception
)
{
Timber
.
e
(
e
,
"Failed to retrieve endpoint URL for $currentEnvironment:$variableKey"
)
throw
IllegalStateException
(
"Failed to setup test environment"
,
e
)
throw
IllegalStateException
(
"Failed to retrieve $currentEnvironment:$variableKey"
,
e
)
}
}
.
also
{
Timber
.
v
(
"getEndpointUrl(endpoint=%s): %s"
,
variableKey
,
it
)
}
}
val
submissionCdnUrl
:
String
get
()
=
getEnvironmentValue
(
SUBMISSION
).
asString
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment