# Suppress\_callback\_exception is not working

**URL:** <https://community.plotly.com/t/suppress-callback-exception-is-not-working/65333>\
**Category:** Dash Python\
**Tags:** question\
**Created:** [June 21, 2022, 11:27pm UTC](https://community.plotly.com/t/suppress-callback-exception-is-not-working/65333 "2022-06-21T23:27:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anarchocaps](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@anarchocaps](https://community.plotly.com/u/anarchocaps)\
**Post date:** [June 21, 2022, 11:27pm UTC](https://community.plotly.com/t/suppress-callback-exception-is-not-working/65333/1 "2022-06-21T23:27:18Z")

</div>

The below app is functioning correctly, and per the error message, I have stated `suppress_callback_exceptions=True` since I am ‘assigning callbacks to components that are generated by other callbacks’

However, I continue to get `ID not found in layout` errors.

What am I doing wrong?

```auto
from dash import Input, Output, State
from dash.exceptions import PreventUpdate
from dash import html, dcc
import dash_bootstrap_components as dbc

app = dash.Dash(
    __name__ ,
    prevent_initial_callbacks=True,
    suppress_callback_exceptions=True
)

def login_layout():
    return html.Div([
    dbc.Input(id='username', placeholder="username", autofocus='True'),
    dbc.Input(id='password', placeholder="password"),
    dbc.Button('submit', id='button'),
    html.Div(id='message')
    ], id='main_div')

def app_layout():
    return html.Div([
        dbc.Row([
            dbc.Col([
                dcc.Dropdown(['a', 'b'], id = 'test2'),
                dcc.Dropdown(['c', 'd'], id = 'test1'),
                dbc.Input(id='input1'),
                dbc.Input(id = 'input2'),
                html.Div(id='appchild')
            ])
        ])
    ])

app.layout = login_layout()

d = {'user1':'pw1', 'user2':'pw2'}

@app.callback(
    Output('main_div', 'children'),
    Output('message', 'children'),
    Input('button', 'n_clicks'),
    State('username', 'value'),
    State('password', 'value')
)
def upload_template(n_clicks, username, password):
    if n_clicks:
        if d.get(username) == password:
            print(username)
            return app_layout(), None
        else:
            return login_layout(), 'Incorrect Password'
    else:
        raise PreventUpdate

@app.callback(
    Output('appchild', 'children'),
    Input('test2', 'value'),
    Input('test1', 'value')
)
def upload_template(value1, value2):
    return value1 + value2

if __name__ == ' __main__':
    app.run_server(debug=True)

```

---

<div class="post-metadata">

**Author:** ![AnnMarieW](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@AnnMarieW](https://community.plotly.com/u/AnnMarieW)\
**Post date:** [June 22, 2022, 12:33am UTC](https://community.plotly.com/t/suppress-callback-exception-is-not-working/65333/2 "2022-06-22T00:33:01Z")

</div>

Hi @anarchocaps when I ran your code I didn’t get an ID not found in layout error, but I did get:

> TypeError: can only concatenate str (not “NoneType”) to str

The error is in this line, since the dropdown values are None.  
`return value1 + value2`
