How to raise an exception in DBT macro

I am converting pl sql code to dbt. This code validates data based on certain rules and then raises exception if it fails.

I understand we can’t raise exceptions in dbt models, so i have created a macro and am using exceptions.raise_compiler_error within if block but its giving syntax error.

Code Snippet, If condition is giving error -

{% macro test_scenarios_macro(input_number) %}

{% set sql_statement %}
select count(1)
from table1
where column1 = ‘{{input_number}}’
{% endset %}

{%- set lkp_EMIS_SOURCE_ID = dbt_utils.get_single_value(sql_statement, default=“‘NULL’”) -%}

{% if {{lkp_EMIS_SOURCE_ID}} == 6 %}
{{ exceptions.raise_compiler_error(“WRONG INPUT”) }}
{% endif %}

{% endmacro %}

try removing {{ }}

such as

{% if lkp_EMIS_SOURCE_ID == 6 %}

Thanks, that worked for me. Now I am getting same error for no equal to condition.

{% if lkp_EMIS_SOURCE_ID != 6 %}
{{ exceptions.raise_compiler_error(“WRONG INPUT”) }}
{% endif %}

Also, can you please help me to understand where does dbt captures this exception. Can I provide my custom schema/ table to capture exceptions.