Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Molstar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michal Malý
Molstar
Commits
c5e2471f
Commit
c5e2471f
authored
5 years ago
by
David Sehnal
Browse files
Options
Downloads
Patches
Plain Diff
mol-state/task: use console.error only when not in production mode
parent
e9802f21
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/mol-state/state.ts
+2
-1
2 additions, 1 deletion
src/mol-state/state.ts
src/mol-task/execution/observable.ts
+2
-5
2 additions, 5 deletions
src/mol-task/execution/observable.ts
with
4 additions
and
6 deletions
src/mol-state/state.ts
+
2
−
1
View file @
c5e2471f
...
@@ -20,6 +20,7 @@ import { now, formatTimespan } from '../mol-util/now';
...
@@ -20,6 +20,7 @@ import { now, formatTimespan } from '../mol-util/now';
import
{
ParamDefinition
}
from
'
../mol-util/param-definition
'
;
import
{
ParamDefinition
}
from
'
../mol-util/param-definition
'
;
import
{
StateTreeSpine
}
from
'
./tree/spine
'
;
import
{
StateTreeSpine
}
from
'
./tree/spine
'
;
import
{
AsyncQueue
}
from
'
../mol-util/async-queue
'
;
import
{
AsyncQueue
}
from
'
../mol-util/async-queue
'
;
import
{
isProductionMode
}
from
'
../mol-util/debug
'
export
{
State
}
export
{
State
}
...
@@ -586,7 +587,7 @@ async function updateSubtree(ctx: UpdateContext, root: Ref) {
...
@@ -586,7 +587,7 @@ async function updateSubtree(ctx: UpdateContext, root: Ref) {
ctx
.
changed
=
true
;
ctx
.
changed
=
true
;
if
(
!
ctx
.
hadError
)
ctx
.
newCurrent
=
root
;
if
(
!
ctx
.
hadError
)
ctx
.
newCurrent
=
root
;
doError
(
ctx
,
root
,
e
,
false
);
doError
(
ctx
,
root
,
e
,
false
);
console
.
error
(
e
);
if
(
!
isProductionMode
)
console
.
error
(
e
);
return
;
return
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/mol-task/execution/observable.ts
+
2
−
5
View file @
c5e2471f
...
@@ -10,6 +10,7 @@ import { Progress } from './progress'
...
@@ -10,6 +10,7 @@ import { Progress } from './progress'
import
{
now
}
from
'
../../mol-util/now
'
;
import
{
now
}
from
'
../../mol-util/now
'
;
import
{
Scheduler
}
from
'
../util/scheduler
'
import
{
Scheduler
}
from
'
../util/scheduler
'
import
{
UserTiming
}
from
'
../util/user-timing
'
import
{
UserTiming
}
from
'
../util/user-timing
'
import
{
isProductionMode
}
from
'
../../mol-util/debug
'
interface
ExposedTask
<
T
>
extends
Task
<
T
>
{
interface
ExposedTask
<
T
>
extends
Task
<
T
>
{
f
:
(
ctx
:
RuntimeContext
)
=>
Promise
<
T
>
,
f
:
(
ctx
:
RuntimeContext
)
=>
Promise
<
T
>
,
...
@@ -30,10 +31,6 @@ export function ExecuteObservableChild<T>(ctx: RuntimeContext, task: Task<T>, pr
...
@@ -30,10 +31,6 @@ export function ExecuteObservableChild<T>(ctx: RuntimeContext, task: Task<T>, pr
return
(
ctx
as
ObservableRuntimeContext
).
runChild
(
task
as
ExposedTask
<
T
>
,
progress
);
return
(
ctx
as
ObservableRuntimeContext
).
runChild
(
task
as
ExposedTask
<
T
>
,
progress
);
}
}
export
namespace
ExecuteObservable
{
export
let
PRINT_ERRORS_TO_STD_ERR
=
false
;
}
function
defaultProgress
(
task
:
Task
<
any
>
):
Task
.
Progress
{
function
defaultProgress
(
task
:
Task
<
any
>
):
Task
.
Progress
{
return
{
return
{
taskId
:
task
.
id
,
taskId
:
task
.
id
,
...
@@ -112,7 +109,7 @@ async function execute<T>(task: ExposedTask<T>, ctx: ObservableRuntimeContext) {
...
@@ -112,7 +109,7 @@ async function execute<T>(task: ExposedTask<T>, ctx: ObservableRuntimeContext) {
task
.
onAbort
();
task
.
onAbort
();
}
}
}
}
if
(
ExecuteObservable
.
PRINT_ERRORS_TO_STD_ERR
)
console
.
error
(
e
);
if
(
!
isProductionMode
)
console
.
error
(
e
);
throw
e
;
throw
e
;
}
}
}
}
...
...
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